-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (35 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
44 lines (35 loc) · 1.03 KB
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
# Set the base image steamcmd
FROM python:3.13-slim
# Set environment variables
ENV USER steamcmd
ENV HOME /data
ENV PORT 8000
ENV WORKERS 4
################## BEGIN INSTALLATION ######################
# Install Python requirements
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir "uvicorn[standard]" gunicorn \
&& pip3 install --no-cache-dir -r /tmp/requirements.txt \
&& rm /tmp/requirements.txt
# Create the application user
RUN useradd -m -d $HOME $USER
# Switch user and set working dir
USER $USER
WORKDIR $HOME
# Copy application code
COPY --chown=$USER:$USER src/ $HOME/
##################### INSTALLATION END #####################
# Set default container command
CMD exec gunicorn web:app \
--max-requests 1000 \
--max-requests-jitter 100 \
--workers $WORKERS \
--worker-class uvicorn.workers.UvicornWorker \
--bind 0.0.0.0:$PORT \
--timeout 30 \
--keep-alive 2 \
--worker-connections 1000 \
--preload \
--access-logfile - \
--error-logfile - \
--log-level info