parsley/Dockerfile
Dan Elbert f5e32cf888
Some checks failed
parsley/pipeline/head There was a failure building this commit
Fix dockerfile
2024-10-18 14:42:04 -05:00

41 lines
1.1 KiB
Docker

FROM ruby:3.3.5-bookworm
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get update && apt-get dist-upgrade -y && \
apt-get install -y \
nodejs \
nginx && \
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN gem update --no-document --system && gem install bundler --no-document && corepack enable
# Install nginx config files
RUN rm /etc/nginx/sites-enabled/default
ADD docker/nginx_server.conf /etc/nginx/sites-enabled/parsley.conf
# Add scripts
ADD docker/bin/* /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/nginx_service.sh /usr/local/bin/rails_service.sh
# Set Default RAILS_ENV
ENV RAILS_ENV docker
# Setup directory and install gems
RUN mkdir -p /parsley
WORKDIR /parsley
COPY Gemfile* ./
RUN bundle install
COPY package.json yarn.lock ./
RUN yarn install --production=true --frozen-lockfile
COPY . .
# Compile assets
RUN env RAILS_ENV=production bundle exec rails webpacker:clobber webpacker:compile
ENV PORT=80
EXPOSE 80
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]