-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathDockerfile.production
More file actions
28 lines (20 loc) · 777 Bytes
/
Dockerfile.production
File metadata and controls
28 lines (20 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM ruby:2.5.5-alpine
RUN apk update && apk add build-base git nodejs python2 postgresql-dev postgresql-client graphicsmagick --no-cache yarn
# Make busybox and pry work nicely for large output
ENV PAGER='more'
RUN mkdir /app
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN bundle install --without development test
COPY package.json yarn.lock ./
RUN set -ex; \
yarn install --frozen-lockfile --production; \
yarn cache clean;
COPY . .
# Build production assets into image
# Need keys to be set to start server but they don't need to be valid
ENV SECRET_KEY_BASE bunchofgarbage
ENV DATABASE_URL postgresql://just@start:5432/theserver
ENV REDIS_BASE_URL redis://please:6379/0
RUN RAILS_ENV=production bin/bundle exec rake assets:precompile
CMD puma -C config/puma.rb