This repository was archived by the owner on Feb 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (30 loc) · 1.35 KB
/
Dockerfile
File metadata and controls
41 lines (30 loc) · 1.35 KB
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
FROM ruby:2.6
LABEL maintainer="T Jenkins"
# Autoprefixer doesn’t support Node v4.8.2. Update it.
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
## To install the Yarn package manager (rails assets:precompile complains if not installed), run:
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq \
&& apt-get install -y build-essential \
libpq-dev \
nodejs \
yarn \
tzdata \
&& rm -rf /var/lib/apt/lists/*
ENV APP_ROOT /app
RUN mkdir -p $APP_ROOT
WORKDIR $APP_ROOT
RUN mkdir -p tmp/pids
RUN touch tmp/pids/server.pid
# Preinstall gems in an earlier layer so we don't reinstall every time any file changes.
COPY Gemfile $APP_ROOT
COPY Gemfile.lock $APP_ROOT
RUN bundle config --local build.sassc --disable-march-tune-native
RUN bundle install --without development test --jobs=3 --retry=3
# *NOW* we copy the codebase in
COPY . $APP_ROOT
# Precompile Rails assets. We set a dummy database url/token key
RUN RAILS_ENV=production DATABASE_URL=postgresql://user:pass@127.0.0.1/dbname SECRET_KEY_BASE=pickasecuretoken bundle exec rake assets:precompile
EXPOSE 3000
CMD bundle exec puma -C config/puma.rb