-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
46 lines (30 loc) · 1.18 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
FROM python:3.11
# TODO
# LABEL org.opencontainers.image.source="https://github.com/UST-QuAntiL/qhana-plugin-runner"
# install git and remove caches again in same layer
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends git && apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN useradd gunicorn
ENV FLASK_APP=qunicorn_core
# can be server or worker
ENV CONTAINER_MODE=server
ENV DEFAULT_LOG_LEVEL=INFO
ENV CONCURRENCY=2
ENV CELERY_WORKER_POOL=threads
ENV EXECUTE_CELERY_TASK_ASYNCHRONOUS=True
ENV RUNNING_IN_DOCKER=True
# make directories and set user rights
RUN mkdir --parents /app/instance \
&& chown --recursive gunicorn /app && chmod --recursive u+rw /app/instance
# Wait for database
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait
RUN chmod +x /wait
RUN python -m pip install poetry
COPY --chown=gunicorn . /app
RUN python -m poetry export --without-hashes --format=requirements.txt -o requirements.txt && python -m pip install -r requirements.txt
VOLUME ["/app/instance"]
ENV INSTANCE_PATH="/app/instance"
EXPOSE 5005
USER gunicorn
ENTRYPOINT ["python","-m", "invoke", "start-docker"]