gitops-status-api/Dockerfile
dvirlabs 49daeac90d
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Update base image
2026-04-21 16:08:17 +03:00

34 lines
682 B
Docker

FROM python:3.11-slim
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY app.py .
# Create data directory for status.json
RUN mkdir -p /data && chmod 777 /data
# Non-root user
RUN useradd -m -u 1000 apiuser && \
chown -R apiuser:apiuser /app /data
USER apiuser
# Health checks
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:5000/health')" || exit 1
EXPOSE 5000
ENV FLASK_ENV=production \
API_HOST=0.0.0.0 \
API_PORT=5000 \
STATUS_FILE=/data/status.json
CMD ["python", "app.py"]