-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-readme
- Loading branch information
Showing
10 changed files
with
49 additions
and
167 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
work | ||
*.log | ||
*.dev | ||
.git* | ||
.local-dev | ||
log | ||
tmp | ||
.idea | ||
doc | ||
dumps | ||
coverage | ||
.github | ||
node_modules | ||
spec | ||
README.md |
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 |
---|---|---|
|
@@ -55,8 +55,6 @@ jobs: | |
env: | ||
RAILS_ENV: test | ||
DATABASE_URL: "postgresql://postgres:[email protected]" | ||
AWS_ACCESS_KEY_ID: 123 | ||
AWS_SECRET_ACCESS_KEY: 456 | ||
COVERAGE: true | ||
CI: true | ||
CI_TOTAL_JOBS: ${{ matrix.ci_total_jobs }} | ||
|
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,44 +1,53 @@ | ||
FROM ruby:3.1.4-alpine | ||
LABEL key="Ministry of Justice, Track a Query <[email protected]>" | ||
RUN set -ex | ||
FROM ruby:3.1.4-alpine as builder | ||
|
||
RUN addgroup --gid 1000 --system appgroup && \ | ||
adduser --uid 1000 --system appuser --ingroup appgroup | ||
WORKDIR /app | ||
|
||
# Some app dependencies | ||
RUN apk add libreoffice clamav clamav-daemon freshclam ttf-freefont | ||
RUN apk --no-cache add \ | ||
build-base \ | ||
ruby-dev \ | ||
postgresql-dev \ | ||
git \ | ||
yarn | ||
|
||
# Note: .ruby-gemdeps libc-dev gcc libxml2-dev libxslt-dev make postgresql-dev build-base - these help with bundle install issues | ||
RUN apk add --no-cache --virtual .ruby-gemdeps libc-dev gcc libxml2-dev libxslt-dev make postgresql-dev build-base git nodejs zip postgresql-client yarn | ||
COPY .ruby-version Gemfile* package.json yarn.lock ./ | ||
|
||
RUN apk --update add less && apk -U upgrade && apk --no-cache upgrade musl | ||
# Install gems and node packages | ||
RUN bundle config deployment true && \ | ||
bundle config without development test && \ | ||
bundle install --jobs 4 --retry 3 && \ | ||
yarn install --frozen-lockfile --production | ||
|
||
WORKDIR /usr/src/app/ | ||
COPY . . | ||
|
||
COPY Gemfile* ./ | ||
RUN RAILS_ENV=production SECRET_KEY_BASE_DUMMY=1 \ | ||
bundle exec rake assets:precompile | ||
|
||
RUN gem install bundler -v '~> 2.4.19' | ||
# Cleanup to save space in the production image | ||
RUN rm -rf node_modules log/* tmp/* /tmp && \ | ||
rm -rf /usr/local/bundle/cache | ||
|
||
RUN bundle config deployment true && \ | ||
bundle config without development test && \ | ||
bundle install --jobs 4 --retry 3 | ||
# Build runtime image | ||
FROM ruby:3.1.4-alpine | ||
|
||
COPY . . | ||
# The application runs from /app | ||
WORKDIR /app | ||
|
||
RUN yarn install --pure-lockfile | ||
RUN apk --no-cache add \ | ||
nodejs \ | ||
postgresql-client | ||
|
||
RUN mkdir -p log tmp tmp/pids | ||
RUN chown -R appuser:appgroup /usr/src/app/ | ||
USER appuser | ||
USER 1000 | ||
RUN addgroup -g 1000 -S appgroup && \ | ||
adduser -u 1000 -S appuser -G appgroup | ||
|
||
RUN RAILS_ENV=production AWS_ACCESS_KEY_ID=not_real AWS_SECRET_ACCESS_KEY=not_real bundle exec rake assets:clean assets:precompile assets:non_digested SECRET_KEY_BASE=required_but_does_not_matter_for_assets 2> /dev/null | ||
# Copy files generated in the builder image | ||
COPY --from=builder /app /app | ||
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/ | ||
|
||
ENV PUMA_PORT 3000 | ||
EXPOSE $PUMA_PORT | ||
RUN mkdir -p log tmp tmp/pids | ||
RUN chown -R appuser:appgroup log tmp | ||
|
||
RUN chown -R appuser:appgroup ./* | ||
RUN chmod +x /usr/src/app/config/docker/* | ||
USER 1000 | ||
|
||
# expect/add ping environment variables | ||
ARG APP_GIT_COMMIT | ||
|
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 |
---|---|---|
|
@@ -705,5 +705,8 @@ DEPENDENCIES | |
turbolinks (~> 5) | ||
tzinfo-data | ||
|
||
RUBY VERSION | ||
ruby 3.1.4p223 | ||
|
||
BUNDLED WITH | ||
2.4.19 |
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.