Skip to content

Commit

Permalink
fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
mortbauer committed Dec 23, 2024
1 parent a3c0324 commit a31f227
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,31 @@ 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


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

Expand Down

0 comments on commit a31f227

Please sign in to comment.