-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (24 loc) · 969 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
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.11-slim
#FROM python:3.11
LABEL maintainer="Dennis Priskorn <[email protected]>"
ENV DOCKER=true
WORKDIR /app
COPY pyproject.toml .
# RUN pip install --no-cache-dir --upgrade pip && \
# pip install --no-cache-dir poetry && \
# poetry install
RUN pip install --no-cache-dir poetry==1.7.1 && poetry config virtualenvs.create false
COPY pyproject.toml .
# Don't install dev dependencies
RUN poetry install --no-interaction --no-ansi --without=dev
COPY . ./
# configure the container to run in an executed manner (debug only)
# ENTRYPOINT [ "python" ]
#
# CMD ["app.py" ]
# Run in production using gunicorn and threaded using 20 workers
# We bind via port, not socket
# We increase the to 45s from the default 30 because
# getting data from SPARQL and for labels is quite slow
# Also log requests to console (DEBUG)
CMD ["poetry", "run", "gunicorn", "-w", "3", "-b", "0.0.0.0:5001", "app:app", "--timeout", "120", "--access-logfile", "-"]