-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (23 loc) · 891 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
36
37
ARG AZLINUX_BASE_VERSION=master
# Base stage with python-build-base
FROM quay.io/cdis/python-nginx-al:${AZLINUX_BASE_VERSION} AS base
ENV appname=gen3workflow
WORKDIR /${appname}
RUN chown -R gen3:gen3 /${appname}
# Builder stage
FROM base AS builder
USER gen3
# copy ONLY poetry artifact, install the dependencies but not the app;
# this will make sure that the dependencies are cached
COPY poetry.lock pyproject.toml /${appname}/
RUN poetry install -vv --no-root --only main --no-interaction
COPY --chown=gen3:gen3 . /${appname}
# install the app
RUN poetry install --without dev --no-interaction
# Final stage
FROM base
COPY --from=builder /${appname} /${appname}
# Switch to non-root user 'gen3' for the serving process
USER gen3
WORKDIR /${appname}
CMD ["poetry", "run", "gunicorn", "gen3workflow.app:app", "-k", "uvicorn.workers.UvicornWorker", "-c", "gunicorn.conf.py"]