Skip to content
Merged

Dev #66

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim AS base_image
FROM python:3.14-slim AS base_image

FROM base_image AS builder
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
Expand Down Expand Up @@ -39,8 +39,7 @@ RUN --mount=type=cache,target=${UV_CACHE_DIR} \
./uv/bin/uv sync --group deploy --no-dev --no-editable --no-install-project --find-links=/wheels && \
./uv/bin/uv pip install --find-links=/wheels --no-index getmarcapi --no-deps
EXPOSE 5000
COPY api.cfg /app/settings.cfg
ENV GETMARCAPI_SETTINGS=/app/settings.cfg
RUN ./.venv/bin/python -m getmarcapi --check
CMD ./.venv/bin/gunicorn getmarcapi.app:app --bind 0.0.0.0:5000 --log-level=debug
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl -f http://localhost:5000 || exit 1
CMD ./.venv/bin/python -m getmarcapi --check && ./.venv/bin/gunicorn getmarcapi.app:app --bind 0.0.0.0:5000 --log-level=debug

30 changes: 30 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
getmarcapi
==========

Config File
-----------

This application requires a configuration file to run. It should be in INI format
and contain the following sections and options:

.. code-block:: ini

[ALMA_API]
API_DOMAIN=
API_KEY=


Using the Docker Image
----------------------

This Docker image requires a config file (see Config File section above) to be
mounted into the container in order to function properly. By default, the
container will look for the config file at inside the container at
`/app/settings.cfg` but this can be changed by running the container with the
GETMARCAPI_SETTINGS environment variable set to another path.

Port 5000 inside the container is used for the web server, so this port should
be forwarded to the host machine.

For example, you can run the container like this:

.. code-block:: sh

docker run -d -p 5000:5000 -v /path/to/your/settings.cfg:/app/settings.cfg:ro --name getmarc getmarcapi
5 changes: 3 additions & 2 deletions ci/docker/python/linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ARG PYTHON_VERSION="latest"

FROM ghcr.io/astral-sh/uv:latest AS uv_builder
FROM python:${PYTHON_VERSION} AS base_image

#==============================================================================
Expand All @@ -16,5 +18,4 @@ RUN n stable -y && \
mkdir /.npm && \
chmod 777 /.npm

RUN mkdir -p /home/user/.sonar/ && chmod -R 777 /home/user/

COPY --from=uv_builder /uv /uvx /bin/
766 changes: 440 additions & 326 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"css-loader": "^6.7.2",
"style-loader": "^3.3.1",
"webpack": "5.75.0",
"webpack": "^5.104.1",
"webpack-cli": "^5.0.0"
},
"dependencies": {
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "getmarcapi"
version = "0.0.4.dev0"
dependencies = [
'flask',
'uiucprescon.getmarc2>=0.1.3',
'uiucprescon.getmarc2>=0.1.5',
'typing-extensions;python_version<"3.8"'
]
requires-python = ">= 3.10"
Expand All @@ -21,6 +21,7 @@ maintainers = [
]
description = "Provide MARC XML data"
[dependency-groups]
audit-dependencies = ['uv-secure']
deploy = ['gunicorn', 'python-dotenv']
test = ['pytest']
tox = ["tox"]
Expand All @@ -39,6 +40,7 @@ dev = [
{include-group = "publish"},
{include-group = "test"},
{include-group = "tox"},
{include-group = "audit-dependencies"},
]
ci = ["pysonar", {include-group = "dev"}]

Expand All @@ -48,6 +50,7 @@ Download = "https://github.com/UIUCLibrary/"
[tool.setuptools]
packages = [
"getmarcapi",
"getmarcapi.templates"
]
include-package-data = true
zip-safe = true
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py310, py311, py312, py313
envlist = py310, py311, py312, py313, py314, py314t
isolated_build = true
minversion = 2.0

Expand Down
524 changes: 472 additions & 52 deletions uv.lock

Large diffs are not rendered by default.

298 changes: 143 additions & 155 deletions vars/runJenkinsPipeline.groovy

Large diffs are not rendered by default.