Rails 'VERSION >=8.x' - SQLite ONLY
ARG RUBY_VERSION=3.3.6
FROM ruby:$RUBY_VERSION
ENV RAILS_ENV=production \
BUNDLE_PATH=/bundle \
BUNDLE_WITHOUT="development test" \
PATH=/app/bin:/app/vendor/bundle/bin:$PATH
WORKDIR /app
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
build-essential libpq-dev nodejs yarn && \
rm -rf /var/lib/apt/lists/*
COPY Gemfile Gemfile.lock ./
RUN bundle install
COPY . .
RUN bundle exec rake assets:precompile
RUN bundle exec rake db:prepare
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
services:
app:
container_name: <custom-container-name-app>
build:
context: .
dockerfile: Dockerfile
image: <custom-image-name>:latest
command: bundle exec puma -C config/puma.rb
ports:
- "3000:3000"
volumes:
- db_data:/app/db
jobs:
container_name: <custom-container-name-jobs>
build:
context: .
dockerfile: Dockerfile
image: <custom-image-name>:latest
command: bin/jobs
volumes:
- db_data:/app/db
volumes:
db_data: