Skip to content

Commit

Permalink
add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky committed Feb 8, 2024
1 parent 253291d commit 11adddf
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
FROM ocrd/core:v2.62.0 AS base
ARG VCS_REF
ARG BUILD_DATE
LABEL \
maintainer="https://github.com/OCR-D/ocrd_segment/issues" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/OCR-D/ocrd_segment" \
org.label-schema.build-date=$BUILD_DATE

WORKDIR /build-ocrd_segment
WORKDIR /build
COPY setup.py .
COPY ocrd_segment/ocrd-tool.json .
COPY ocrd_segment ./ocrd_segment
COPY requirements.txt .
COPY README.md .
RUN pip install . \
&& rm -rf /build-ocrd_segment
RUN pip install .
RUN rm -rf /build

WORKDIR /data
VOLUME ["/data"]
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
SHELL = /bin/bash
PYTHON ?= python
PIP ?= pip
TAG ?= ocrd/segment

# BEGIN-EVAL makefile-parser --make-help Makefile

help:
@echo ""
@echo " Targets"
@echo ""
@echo " deps (install required Python packages)"
@echo " install (install this Python package)"
@echo " docker (build Docker image)"
@echo ""

# END-EVAL

# (install required Python packages)
deps:
$(PIP) install -r requirements.txt

#deps-test:
# $(PIP) install -r requirements_test.txt

# Dependencies for deployment in an ubuntu/debian linux
# deps-ubuntu:
# sudo apt-get install -y \
# ...

# (install this Python package)
install: deps
$(PIP) install .

docker:
docker build \
-t $(TAG) \
--build-arg VCS_REF=$(git rev-parse --short HEAD) \
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") .

.PHONY: help deps install docker # deps-test test

0 comments on commit 11adddf

Please sign in to comment.