-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerfile updates for traject #53
Open
aelkiss
wants to merge
1
commit into
main
Choose a base branch
from
remove-wait-for
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+48
−22
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,21 +1,30 @@ | ||
FROM jruby:9.4-jdk17 | ||
FROM jruby:9.4-jdk17 AS base | ||
ARG UNAME=app | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
||
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ | ||
build-essential \ | ||
netbase \ | ||
netcat | ||
netbase | ||
|
||
RUN groupadd -g ${GID} -o ${UNAME} | ||
RUN useradd -m -d /app -u ${UID} -g ${GID} -o -s /bin/bash ${UNAME} | ||
RUN mkdir -p /gems && chown ${UID}:${GID} /gems | ||
|
||
# COPY --chown=${UID}:${GID} Gemfile* /app/ | ||
WORKDIR /app | ||
RUN wget -O /usr/local/bin/wait-for https://github.com/eficode/wait-for/releases/download/v2.2.3/wait-for && chmod +x /usr/local/bin/wait-for | ||
|
||
# USER $UNAME | ||
ENV BUNDLE_PATH /gems | ||
RUN gem install bundler | ||
|
||
FROM base AS development | ||
|
||
FROM base AS production | ||
|
||
RUN groupadd -g $GID -o $UNAME | ||
RUN useradd -m -d /app -u $UID -g $GID -o -s /bin/bash $UNAME | ||
RUN mkdir -p /gems && chown $UID:$GID /gems | ||
USER $UNAME | ||
COPY --chown=$UID:$GID Gemfile* /app | ||
WORKDIR /app | ||
ENV BUNDLE_PATH /gems | ||
RUN bundle install | ||
COPY --chown=$UID:$GID . /app | ||
|
||
LABEL org.opencontainers.image.source="https://github.com/hathitrust/hathitrust_catalog_indexer" |
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,38 +1,60 @@ | ||
--- | ||
|
||
x-condition-healthy: &healthy | ||
condition: service_healthy | ||
|
||
x-healthcheck-defaults: &healthcheck-defaults | ||
interval: 5s | ||
timeout: 10s | ||
start_period: 10s | ||
retries: 5 | ||
|
||
services: | ||
traject: | ||
build: . | ||
build: | ||
context: . | ||
target: development | ||
volumes: | ||
- .:/app | ||
- gem_cache:/gems | ||
environment: | ||
- SOLR_URL=http://solr-sdr-catalog:9033/solr/catalog | ||
- redirect_file=/dev/null | ||
- NO_DB=1 | ||
network_mode: host | ||
command: sleep infinity | ||
|
||
test: | ||
build: . | ||
build: | ||
context: . | ||
target: development | ||
volumes: | ||
- .:/app | ||
- gem_cache:/gems | ||
command: bash -c "wait-for solr-sdr-catalog:9033 mariadb:3306 && JRUBY_OPTS='--debug' bundle exec rspec" | ||
command: bundle exec rspec | ||
environment: | ||
- JRUBY_OPTS=--debug | ||
- SOLR_URL=http://solr-sdr-catalog:9033/solr/catalog | ||
- redirect_file=/dev/null | ||
depends_on: | ||
- solr-sdr-catalog | ||
- mariadb | ||
solr-sdr-catalog: *healthy | ||
mariadb: *healthy | ||
|
||
solr-sdr-catalog: | ||
build: solr | ||
ports: | ||
- "9033:9033" | ||
healthcheck: | ||
<<: *healthcheck-defaults | ||
test: [ "CMD", "curl","-s","-f","http://localhost:9033/solr/catalog/admin/ping" ] | ||
|
||
mariadb: | ||
image: ghcr.io/hathitrust/db-image:latest | ||
ports: | ||
- "3306:3306" | ||
healthcheck: | ||
<<: *healthcheck-defaults | ||
test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ] | ||
|
||
volumes: | ||
gem_cache: |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should revert this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't be opposed to bringing this file up to date with whatever is in the production DB and then
.gitignore
ing it. I've run against problems using this repo (or maybe it washathifiles
) with a stale table like this, against real-world Zephir data (bails out due to inability to find a recent institution code). It'll always be a moving target, however. Maybe worth a note in the readme.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moseshll If you have time to do that then we can go ahead and merge this.