This repository has been archived by the owner on May 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
48 lines (35 loc) · 1.42 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
# Base our image on an official, minimal image of our preferred Ruby
FROM ruby:2.4.1-slim
ENV RAILS_ROOT /app
ENV RAILS_ENV production
ENV DOCKER true
ENV LOG_TO_STDOUT true
# Install essential Linux packages
RUN apt-get update -qq \
&& apt-get install -y \
bundler \
nodejs \
libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/*
# Set our working directory inside the image
RUN mkdir $RAILS_ROOT
WORKDIR $RAILS_ROOT
# Use the Gemfiles as Docker cache markers. Always bundle before copying app src.
# (the src likely changed and we don't want to invalidate Docker's cache too early)
# http://ilikestuffblog.com/2014/01/06/how-to-skip-bundle-install-when-deploying-a-rails-app-to-docker/
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
# Prevent bundler warnings; ensure that the bundler version executed is >= that which created Gemfile.lock
RUN gem install bundler rake \
&& bundle install --jobs=5 --without development test \
&& bundle clean --force
# Copy the Rails application into place
COPY . .
RUN $RAILS_ROOT/serverSetup.sh
EXPOSE 3000
# Define the script we want run once the container boots
# Use the "exec" form of CMD so our script shuts down gracefully on SIGTERM (i.e. `docker stop`)
CMD exec bundle exec puma -e production -C $RAILS_ROOT/config/puma.rb $RAILS_ROOT/config.ru
VOLUME $RAILS_ROOT/db/
# Notes to remind me how to build this thing when I forget
# docker build -t plex-board .