count-anything/Dockerfile

26 lines
676 B
Docker
Raw Normal View History

# 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 && \
rails assets:precompile
COPY . .
CMD /count_anything/bin/rails db:migrate && /count_anything/bin/rails server