Commit 782f55e2 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

precompile the assets in the docker image

(to speed up the startup)
parent 3a5161b8
...@@ -17,6 +17,8 @@ RUN apply-patches /tmp/ruby/*.diff &&\ ...@@ -17,6 +17,8 @@ RUN apply-patches /tmp/ruby/*.diff &&\
chown allgo: /opt &&\ chown allgo: /opt &&\
su allgo -c 'sh /tmp/ruby/install.sh' su allgo -c 'sh /tmp/ruby/install.sh'
ENV PATH="/opt/ruby/bin:$PATH"
# install ruby gems # install ruby gems
COPY Gemfile* /tmp/ COPY Gemfile* /tmp/
RUN cd /tmp && chown allgo: /tmp/Gemfile* && su allgo -c "bundle install" RUN cd /tmp && chown allgo: /tmp/Gemfile* && su allgo -c "bundle install"
...@@ -34,7 +36,6 @@ RUN sh /opt/allgo/deploy/docker/setup/setup.sh ...@@ -34,7 +36,6 @@ RUN sh /opt/allgo/deploy/docker/setup/setup.sh
USER allgo USER allgo
WORKDIR /opt/allgo WORKDIR /opt/allgo
ENV PATH="/opt/ruby/bin:$PATH"
CMD ["run-allgo"] CMD ["run-allgo"]
LABEL dk.migrate_always=1 LABEL dk.migrate_always=1
......
...@@ -113,6 +113,9 @@ ...@@ -113,6 +113,9 @@
# end # end
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
# short name for the environment
config.short_env = "prod"
# Code is not reloaded between requests. # Code is not reloaded between requests.
config.cache_classes = true config.cache_classes = true
......
...@@ -14,6 +14,11 @@ chown -R nobody: /run ...@@ -14,6 +14,11 @@ chown -R nobody: /run
chmod -R og+rwX /run chmod -R og+rwX /run
# precompile assets
cd /opt/allgo
RAILS_ENV=qualification rake assets:precompile
RAILS_ENV=production rake assets:precompile
# install scripts # install scripts
cd "$SETUP" cd "$SETUP"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment