Skip to content

Commit

Permalink
feat: 🎸 Dockerfile 内での rails コマンドの環境を production に明示的に指定した (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikukyugamer authored Jan 16, 2023
1 parent 3e9edc0 commit ebc01d0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ RUN bundle install

COPY . /myapp

RUN bin/rails assets:precompile
RUN bin/rails db:create
RUN bin/rails db:migrate
RUN bin/rails db:seed
# production ビルド前提になっている
# RAILS_ENV を逐一指定するのではなく一括で指定してもよい
RUN RAILS_ENV=production bin/rails assets:precompile
RUN RAILS_ENV=production bin/rails db:create
RUN RAILS_ENV=production bin/rails db:migrate
RUN RAILS_ENV=production bin/rails db:seed

# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
Expand Down

0 comments on commit ebc01d0

Please sign in to comment.