This repository has been archived on 2025-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
Files
lan-web/Dockerfile
zwitschi 7698adca32
All checks were successful
Build Docker Container / build (push) Successful in 40s
update Dockerfile to newer python version
2025-09-22 10:59:33 +02:00

34 lines
852 B
Docker

FROM python:3.12-slim-trixie
# Set a working directory
WORKDIR /app
# Prevent Python from writing .pyc files and enable unbuffered stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
APP_PORT=8081 \
GUNICORN_CMD_ARGS="--bind=0.0.0.0:8081 --workers=4 --threads=2"
# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd --create-home --shell /bin/bash appuser
# Copy requirements and install
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY . /app
RUN chown -R appuser:appuser /app
USER appuser
# expose the default APP_PORT (can be overridden at runtime)
EXPOSE 8081
# Default command: run the app with gunicorn
CMD ["gunicorn", "--chdir", "./", "app:app"]