forked from Orphanet/API_Orphadata
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 854 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (28 loc) · 854 Bytes
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
### STAGE 1:BUILD ###
FROM python:3.10-slim AS build
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
build-essential gcc
WORKDIR /usr/app
RUN python -m venv /usr/app/venv
ENV PATH="/usr/app/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN pip install gunicorn
### STAGE 2:RUN ###
FROM python:3.10-slim
RUN groupadd -g 999 python && \
useradd -r -u 999 -g python python
RUN mkdir /usr/app && chown python:python /usr/app
WORKDIR /usr/app
COPY --chown=python:python --from=build /usr/app/venv ./venv
COPY --chown=python:python . .
USER 999
ENV DATA_ENV remote
ENV FLASK_ENV production
ENV ELASTIC_URL https://localhost:9200/
ENV ELASTIC_USER ${ELASTIC_USER}
ENV ELASTIC_PASS ${ELASTIC_PASS}
ENV PATH="/usr/app/venv/bin:$PATH"
CMD [ "gunicorn", "--bind", "0.0.0.0:5000", "wsgi" ]
EXPOSE 5000