add dockerfile and gitea workflow

This commit is contained in:
2026-01-10 16:58:16 +01:00
parent d6359519a4
commit 1f971dba82
6 changed files with 154 additions and 0 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Install curl for health check
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Copy the requirements file into the container
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /app
COPY . .
# Make port 80 available to the world outside this container
EXPOSE 80
# Add health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl http://localhost || exit 1
# Run the application using Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:80", "--workers", "4", "wsgi:app"]