Skip to content

Commit 925dd04

Browse files
committed
feat: BREAKING CHANGE. docker image now requires config file at runtime
instead of inserting the API key at build time. It now must be mounted during start up time.
1 parent 6d36759 commit 925dd04

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ RUN --mount=type=cache,target=${UV_CACHE_DIR} \
3939
./uv/bin/uv sync --group deploy --no-dev --no-editable --no-install-project --find-links=/wheels && \
4040
./uv/bin/uv pip install --find-links=/wheels --no-index getmarcapi --no-deps
4141
EXPOSE 5000
42-
COPY api.cfg /app/settings.cfg
4342
ENV GETMARCAPI_SETTINGS=/app/settings.cfg
44-
RUN ./.venv/bin/python -m getmarcapi --check
4543
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl -f http://localhost:5000 || exit 1
46-
CMD ./.venv/bin/gunicorn getmarcapi.app:app --bind 0.0.0.0:5000 --log-level=debug
44+
CMD ./.venv/bin/python -m getmarcapi --check && ./.venv/bin/gunicorn getmarcapi.app:app --bind 0.0.0.0:5000 --log-level=debug
4745

vars/runJenkinsPipeline.groovy

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -659,15 +659,6 @@ def call(){
659659
}
660660
steps{
661661
script{
662-
withCredentials([string(credentialsId: 'ALMA_API_KEY', variable: 'API_KEY')]) {
663-
writeFile(
664-
file: 'api.cfg',
665-
text: '''[ALMA_API]
666-
API_DOMAIN=https://api-na.hosted.exlibrisgroup.com
667-
API_KEY=${API_KEY}
668-
'''
669-
)
670-
}
671662
configFileProvider([configFile(fileId: 'getmarc_deployapi', variable: 'CONFIG_FILE')]) {
672663
def CONFIG = readJSON(file: CONFIG_FILE)['deploy']
673664
def build_args = CONFIG['docker']['build']['buildArgs'].collect{"--build-arg=${it}"}.join(' ')

0 commit comments

Comments
 (0)