diff --git a/Dockerfile b/Dockerfile index 0ab1f820c..4d050dd95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,11 +32,11 @@ COPY spec spec COPY vendor vendor # install dependencies and generate crontab -RUN --mount=type=cache,target=/usr/local/bundle/ \ - echo 'gem: --no-document' >> ~/.gemrc && \ +RUN echo 'gem: --no-document' >> ~/.gemrc && \ gem install bundler -v 2.4.22 && \ bundle config build.nokogiri "--use-system-libraries" && \ bundle config set --local without 'development test' && \ + bundle config set --local deployment 'true' && \ bundle install -j 4 && \ bundle exec whenever >crontab @@ -44,16 +44,19 @@ RUN --mount=type=cache,target=/usr/local/bundle/ \ FROM builder as compiler # compile assets with temporary mysql server -RUN --mount=type=cache,target=/usr/local/bundle/ \ - export DATABASE_URL=mysql2://localhost/temp?encoding=utf8 && \ +RUN export DATABASE_URL=mysql2://localhost/test?encoding=utf8 && \ export SECRET_KEY_BASE=thisisnotimportantnow && \ + echo "SATRTING mariadb ----------" && \ /etc/init.d/mariadb start && \ - mariadb -e "CREATE DATABASE temp" && \ + echo "CREATE temp db ----------" && \ + mariadb -e "CREATE DATABASE test" && \ cp config/app_config.yml.SAMPLE config/app_config.yml && \ cp config/cable.yml.SAMPLE config/cable.yml && \ cp config/database.yml.MySQL_SAMPLE config/database.yml && \ cp config/storage.yml.SAMPLE config/storage.yml && \ + echo "STARTING rake tasks ------------" && \ RAILS_ENV=production bundle exec rake db:setup assets:precompile && \ + echo "STOPPING mariadb ------------" && \ /etc/init.d/mariadb stop && \ cp -r /usr/local/bundle /bundle