-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (24 loc) · 919 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
FROM python:3.12
# FROM python:3.13-slim
# Set OS environment variables
ENV APP_HOME /usr/local/app
ENV APP_MODULE app:application
ENV APP_PORT 80
# Specify the working directory
WORKDIR $APP_HOME
# Install the application dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy in the source code
COPY . ./
# Sets configuration on the image that indicates a port the image would like to expose.
EXPOSE 80
# Setup an app user so the container doesn't run as the root user
RUN useradd app
USER app
# Run the web service on container startup. Here we use the gunicorn
# webserver, with one worker process and 8 threads.
# For environments with multiple CPU cores, increase the number of workers
# to be equal to the cores available.
# CMD exec gunicorn -c $APP_CONFIG -b :$PORT $APP_MODULE
CMD exec gunicorn --bind :$APP_PORT --workers 2 --threads 8 --timeout 0 $APP_MODULE