count-anything/Dockerfile
Louis Vallat 4db7b8f3b8
feat: dockerized rails app
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
2023-04-06 20:58:58 +02:00

25 lines
690 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 install --without development test && \
yarn install
COPY . .
CMD /count_anything/bin/rails assets:precompile && /count_anything/bin/rails db:migrate && /count_anything/bin/rails server