-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 845 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (25 loc) · 845 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
FROM python:3.9.13
RUN apt-get update -y && apt-get install -y python3-pip
# get curl for healthchecks
RUN apt-get install -y curl
WORKDIR /usr/src/app
COPY requirements.txt ./
# Copy the current directory contents into the container at /app
ADD ./services ./services
ADD ./database ./database
ADD requirements.txt .
ADD pip.conf .
RUN mkdir -p /etc/app/cfg
RUN pip install --no-cache-dir -r requirements.txt
# Define environment variable
ENV FLASK_ENV=development
ENV FLASK_DEBUG=1
ENV PIP_CONFIG_FILE pip.conf
ENV PYTHONPATH "${PYTHONPATH}:/usr/src/app"
ENV FLASK_APP=services/user.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_RUN_PORT=5000
EXPOSE $FLASK_RUN_PORT
#CMD ["flask", "run"]
#CMD ["python", "services/user.py"]
CMD ["gunicorn", "-w", "3", "-t", "60", "-b", "0.0.0.0:5000", "services.user:app"]