-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (23 loc) · 747 Bytes
/
Dockerfile
File metadata and controls
27 lines (23 loc) · 747 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
FROM ruby:2.3-slim
# set up env vars
ENV BUILD_DEPS ruby-dev make gcc
ENV RUNTIME_DEPS git libsqlite3-dev nodejs
ENV SECRET_KEY_BASE $(RAILS_ENV=production rails secret)
ENV RAILS_ENV production
ENV RAILS_SERVE_STATIC_FILES true
# copy the app over
COPY . /fireball
# equivalent of "cd"
WORKDIR /fireball
# chaining these together to minimize image size
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y $RUNTIME_DEPS $BUILD_DEPS && \
bundle install --without development test && \
apt-get autoremove -y $BUILD_DEPS && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
rails db:setup && \
rails assets:precompile
# start the server
CMD unicorn -l 0.0.0.0:8080
EXPOSE 8080