-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
32 lines (23 loc) · 866 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
# Set the base image steamcmd
FROM python:3.10-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 main:app --max-requests 3000 --max-requests-jitter 150 --workers $WORKERS --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT