-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathDockerfile
49 lines (38 loc) · 1.04 KB
/
Dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM ruby:2.7.2-alpine3.11
RUN apk update && apk add --update \
build-base \
curl \
git \
nodejs \
npm \
python2 \
postgresql-dev \
postgresql-client \
graphicsmagick &&\
apk add -u yarn
RUN mkdir /app
WORKDIR /app
# NOTE This must match "BUNDLED WITH" in Gemfile.lock
RUN gem install bundler:2.2.4
COPY Gemfile Gemfile.lock ./
RUN bundle install
COPY package.json yarn.lock ./
RUN set -ex; \
yarn install --frozen-lockfile --production; \
yarn cache clean;
# Make busybox and pry work nicely for large output
ENV PAGER='more'
ENV BUNDLE_FORCE_RUBY_PLATFORM=1
ENV RAILS_ENV='production'
# node-scss build issue https://github.com/yarnpkg/yarn/issues/4867#issuecomment-412463845
RUN npm rebuild
COPY . .
# Precompile assets into image
# We need the server to be able to start to run this step
ENV SECRET_KEY_BASE bunchofgarbage
ENV DATABASE_URL postgresql://just@start:5432/theserver
ENV REDIS_BASE_URL redis://please:6379/0
RUN rails assets:precompile
# Cleanup
RUN rm -rf /var/cache/apk/*
CMD ["rails", "server", "-b", "0.0.0.0"]