Refactor Dockerfile and nginxHandler.py

This commit is contained in:
Janis
2023-11-24 17:40:13 +01:00
parent 4160b51e22
commit b6ad4608cb
4 changed files with 12 additions and 33 deletions

View File

@@ -7,18 +7,6 @@ ENV PYTHONUNBUFFERED=1
# Install Python and pip
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv
# Install Docker
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release && \
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y docker-ce docker-ce-cli containerd.io
# Create a virtual environment and activate it
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
@@ -33,8 +21,8 @@ WORKDIR /app
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Expose port 80 for Nginx
EXPOSE 80
# Expose port 25560 - 25570
EXPOSE 25560-25570
# Start Nginx and run the Python app
CMD docker compose up -d --remove-orphans && service nginx start && exec python app.py
CMD service nginx start && exec python app.py