count-anything/Dockerfile
Louis Vallat 57becfdb72
fix: cannot precompile assets before copying rails content
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
2023-04-07 00:22:50 +02:00

26 lines
725 B
Docker

# syntax=docker/dockerfile:1
FROM ruby:3.2.2
ENV RAILS_ENV=production
ENV RAILS_SERVE_STATIC_FILES=yes
ENV RAILS_LOG_TO_STDOUT=yes
EXPOSE 3000
RUN apt-get update && \
curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && \
apt-get install -y sqlite3 neovim curl nodejs --no-install-recommends && \
apt-get clean && \
bundle config --global frozen 1 && \
npm install --global yarn
WORKDIR /count_anything
COPY Gemfile Gemfile.lock package.json yarn.lock ./
RUN bundle config set --local without 'development test' && \
bundle install && \
yarn install
COPY . .
CMD /count_anything/bin/rails assets:precompile && /count_anything/bin/rails db:migrate && /count_anything/bin/rails server