-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
35 lines (26 loc) · 894 Bytes
/
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
FROM ruby:2.5
ARG app_env
ENV APP_ENV ${app_env:-production}
ENV RAILS_ENV $APP_ENV
ENV APP_HOME /usr/local/rocket_answer
WORKDIR $APP_HOME
# Install gems
# COPY vendor/bundle vendor/bundle
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
COPY scripts/bundle_install.sh scripts/bundle_install.sh
RUN /bin/sh scripts/bundle_install.sh
# Prepare App
COPY . $APP_HOME
# Remove Cache
RUN rm -rf vendor/bundle/ruby/*/cache
RUN bundle clean
# Assets Precompile
# 仮のSECRET_KEY_BASE
ENV SECRET_KEY_BASE 0b863d8ea897321e28c6d862c74377c4a7abda3a77c5df73d1211921ab2027f346268862261be8e435732b2a3fa3ec11a2c18c8f2c492de4596af69e059370d1
RUN if [ $RAILS_ENV = "production" ]; then bundle exec rails assets:precompile --trace; fi
ENV SECRET_KEY_BASE 12345
## Expose assets for web container
VOLUME $APP_HOME/public/assets
EXPOSE 3000
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]