-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from zooniverse/rails-dual-boot
Rails dual boot
- Loading branch information
Showing
9 changed files
with
575 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
docker-compose.yml | ||
config/database.yml | ||
config/secrets.yml | ||
config/secrets.yml | ||
docker-compose-rails-next.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM ruby:2.6-slim-buster | ||
|
||
WORKDIR /rails_app | ||
|
||
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache | ||
|
||
RUN --mount=type=cache,id=talk-apt-cache,target=/var/cache/apt --mount=type=cache,id=talk-apt-lib,target=/var/lib/apt \ | ||
apt-get update && \ | ||
apt-get install --no-install-recommends -y \ | ||
build-essential \ | ||
git \ | ||
libpq-dev \ | ||
tmpreaper | ||
|
||
ARG RAILS_ENV=production | ||
ENV RAILS_ENV=$RAILS_ENV | ||
|
||
ADD ./Gemfile.next /rails_app/ | ||
ADD ./Gemfile.next.lock /rails_app/ | ||
|
||
# ensure we use the rails-next gemfile setup to ensure we boot the upgraded libaries | ||
ENV BUNDLE_GEMFILE=Gemfile.next | ||
|
||
RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1` | ||
RUN if [ "$RAILS_ENV" = "development" ]; then bundle install; else bundle install --without development test; fi | ||
|
||
ADD ./ /rails_app | ||
|
||
RUN (git log --format="%H" -n 1 > /rails_app/public/commit_id.txt && rm -rf .git) | ||
|
||
EXPOSE 81 | ||
|
||
CMD [ "/rails_app/docker/start.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Gemfile |
Oops, something went wrong.