48 lines
1.0 KiB
Docker
48 lines
1.0 KiB
Docker
FROM python:3.14-rc-trixie
|
|
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
haproxy \
|
|
supervisor \
|
|
openssl \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy requirements and install
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application
|
|
COPY app.py .
|
|
COPY log_parser.py .
|
|
COPY routes/ routes/
|
|
COPY utils/ utils/
|
|
COPY auth/ auth/
|
|
COPY templates/ templates/
|
|
|
|
# Create directories
|
|
RUN mkdir -p /app/config/auth \
|
|
&& mkdir -p /app/config/ssl \
|
|
&& mkdir -p /etc/supervisor/conf.d \
|
|
&& mkdir -p /var/log/supervisor \
|
|
&& mkdir -p /etc/haproxy
|
|
|
|
# Copy configs
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
CMD curl -f https://localhost:5000 --insecure 2>/dev/null || exit 1
|
|
|
|
EXPOSE 5000 80 443 8404
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|