add docker files

This commit is contained in:
2025-11-24 13:36:32 +02:00
parent b7deb9cb0a
commit fdb4177012
4 changed files with 61 additions and 1 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
# Slim Python image
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# System deps for pip & curl (for healthcheck)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Ensure persistent folders exist
RUN mkdir -p /app/instance /app/assets
# Default port
ENV FLET_PORT=8550
EXPOSE 8550
# Health check
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -fsS http://127.0.0.1:8550/ || exit 1
# Run entrypoint to create superuser and start the app
ENTRYPOINT ["sh", "-c", "python main.py"]