gunicorn/docker/Dockerfile
Benoit Chesneau 469110d647 feat: add official Docker image with GHCR publishing workflow
- Add docker/Dockerfile with non-root user and configurable environment
- Add GitHub Actions workflow to build multi-platform images (amd64/arm64)
- Publish to ghcr.io/benoitc/gunicorn on version tags
- Update documentation with official image usage examples
2026-01-23 19:09:18 +01:00

32 lines
914 B
Docker

FROM python:3.12-slim
LABEL org.opencontainers.image.source=https://github.com/benoitc/gunicorn
LABEL org.opencontainers.image.description="Gunicorn Python WSGI HTTP Server"
LABEL org.opencontainers.image.licenses=MIT
# Create non-root user
RUN useradd --create-home --shell /bin/bash gunicorn
WORKDIR /app
# Install gunicorn
RUN pip install --no-cache-dir gunicorn
# Copy entrypoint script
COPY docker/docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Configuration via environment:
# GUNICORN_BIND - full bind address (default: [::]:8000, IPv4+IPv6)
# GUNICORN_HOST - bind host (default: [::])
# GUNICORN_PORT - bind port (default: 8000)
# GUNICORN_WORKERS - number of workers (default: number of CPUs)
# GUNICORN_ARGS - additional arguments (e.g., "--timeout 120")
USER gunicorn
EXPOSE 8000
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["--help"]