mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-08 19:59:56 +02:00
Merge pull request #137 from qurator-spk/dockerfile
Add Dockerfile and make docker target
This commit is contained in:
commit
51f6ef63f5
3 changed files with 42 additions and 0 deletions
2
.github/workflows/test-eynollah.yml
vendored
2
.github/workflows/test-eynollah.yml
vendored
|
@ -34,3 +34,5 @@ jobs:
|
||||||
pip install -r requirements-test.txt
|
pip install -r requirements-test.txt
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: make test
|
run: make test
|
||||||
|
- name: Test docker build
|
||||||
|
run: make docker
|
||||||
|
|
26
Dockerfile
Normal file
26
Dockerfile
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
ARG DOCKER_BASE_IMAGE
|
||||||
|
FROM $DOCKER_BASE_IMAGE
|
||||||
|
|
||||||
|
ARG VCS_REF
|
||||||
|
ARG BUILD_DATE
|
||||||
|
LABEL \
|
||||||
|
maintainer="https://ocr-d.de/kontakt" \
|
||||||
|
org.label-schema.vcs-ref=$VCS_REF \
|
||||||
|
org.label-schema.vcs-url="https://github.com/qurator-spk/eynollah" \
|
||||||
|
org.label-schema.build-date=$BUILD_DATE
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV PYTHONIOENCODING=utf8
|
||||||
|
ENV XDG_DATA_HOME=/usr/local/share
|
||||||
|
|
||||||
|
WORKDIR /build-eynollah
|
||||||
|
COPY src/ ./src
|
||||||
|
COPY pyproject.toml .
|
||||||
|
COPY requirements.txt .
|
||||||
|
COPY README.md .
|
||||||
|
COPY Makefile .
|
||||||
|
RUN apt-get install -y --no-install-recommends g++
|
||||||
|
RUN make install
|
||||||
|
|
||||||
|
WORKDIR /data
|
||||||
|
VOLUME /data
|
14
Makefile
14
Makefile
|
@ -1,6 +1,11 @@
|
||||||
EYNOLLAH_MODELS ?= $(PWD)/models_eynollah
|
EYNOLLAH_MODELS ?= $(PWD)/models_eynollah
|
||||||
export EYNOLLAH_MODELS
|
export EYNOLLAH_MODELS
|
||||||
|
|
||||||
|
# DOCKER_BASE_IMAGE = artefakt.dev.sbb.berlin:5000/sbb/ocrd_core:v2.68.0
|
||||||
|
DOCKER_BASE_IMAGE = docker.io/ocrd/core:v2.68.0
|
||||||
|
DOCKER_TAG = ocrd/eynollah
|
||||||
|
|
||||||
|
|
||||||
# BEGIN-EVAL makefile-parser --make-help Makefile
|
# BEGIN-EVAL makefile-parser --make-help Makefile
|
||||||
|
|
||||||
help:
|
help:
|
||||||
|
@ -45,3 +50,12 @@ smoke-test:
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
test:
|
test:
|
||||||
pytest tests
|
pytest tests
|
||||||
|
|
||||||
|
# Build docker image
|
||||||
|
docker:
|
||||||
|
docker build \
|
||||||
|
--build-arg DOCKER_BASE_IMAGE=$(DOCKER_BASE_IMAGE) \
|
||||||
|
--build-arg VCS_REF=$$(git rev-parse --short HEAD) \
|
||||||
|
--build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||||
|
-t $(DOCKER_TAG) .
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue