forked from weblyzard/inscriptis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
24 lines (20 loc) · 853 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# Stage 1 - Install build dependencies
#
FROM python:3.11-slim-bullseye AS builder
WORKDIR /inscriptis
RUN python -m venv .venv && .venv/bin/python -m pip install --upgrade pip
RUN .venv/bin/pip install --no-cache-dir inscriptis[web-service] && \
find /inscriptis/.venv \( -type d -a -name test -o -name tests \) -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) -exec rm -rf '{}' \+
#
# Stage 2 - Copy only necessary files to the runner stage
#
FROM python:3.11-slim-bullseye
LABEL maintainer="[email protected]"
# Note: only copy the src directory, to prevent bloating the image with
# irrelevant files from the project directory.
WORKDIR /inscriptis
COPY --from=builder /inscriptis /inscriptis
ENV PATH="/inscriptis/.venv/bin:$PATH"
CMD ["uvicorn", "inscriptis.service.web:app", "--port=5000", "--host=0.0.0.0"]
EXPOSE 5000