forked from 0xngmi/f1rewall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (29 loc) · 962 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
33
34
35
36
37
38
FROM python:3.8-slim
# Set environment variables for application configuration
ENV RECAPTCHA_PUBLIC=$RECAPTCHA_PUBLIC \
RECAPTCHA_PRIVATE=$RECAPTCHA_PRIVATE \
DISCORD_WELCOME_ROOM=$DISCORD_WELCOME_ROOM \
DISCORD_PRIVATE=$DISCORD_PRIVATE \
PORT=$PORT \
PYTHONUNBUFFERED=1
# Create a system group named "docker"
RUN groupadd -r docker
# Create a system user named "docker"
RUN useradd -m -r -g docker docker
# Set the working directory
WORKDIR /app
# Change the ownership of the working directory to the non-root user "docker"
RUN chown -R docker:docker /app
# Switch to the "docker" user
USER docker
# Copy the necessary files
COPY etc ./etc
COPY static ./static
COPY templates ./templates
COPY app.py ./app.py
COPY requirements.txt ./requirements.txt
COPY server.py ./server.py
# Install the required dependencies
RUN python -m pip install --user -r requirements.txt
# Set the command to run the server
CMD ["python", "./server.py"]