good luck
This commit is contained in:
29
Dockerfile
29
Dockerfile
@@ -1,24 +1,25 @@
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.9-slim
|
||||
FROM python:3.13-slim
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
DATA_DIR=/app/app/data
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the current directory contents into the container at /app
|
||||
COPY . /app
|
||||
|
||||
# Install any needed dependencies specified in requirements.txt
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Create the directory for scoreboard data
|
||||
RUN mkdir -p app/data
|
||||
COPY . .
|
||||
|
||||
RUN mkdir -p $DATA_DIR \
|
||||
&& adduser --disabled-password --gecos "" appuser \
|
||||
&& chown -R appuser:appuser /app
|
||||
|
||||
USER appuser
|
||||
|
||||
# Expose the Flask port
|
||||
EXPOSE 2897
|
||||
|
||||
# Run the Flask application
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:2897/')" || exit 1
|
||||
|
||||
CMD ["python", "run.py"]
|
||||
|
||||
Reference in New Issue
Block a user