Files
NeveTimePanel/backend/Dockerfile
arkonsadter 389b92f68a
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Replace Dockerfiles, Compose and Drone CI with clean working setup
2026-03-18 20:02:20 +06:00

31 lines
828 B
Docker

FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app \
PORT=8000 \
WORKERS=2
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt ./
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
COPY . ./
RUN mkdir -p /app/servers /app/data /app/logs \
&& ([ -f /app/users.json ] || echo '{}' > /app/users.json) \
&& ([ -f /app/tickets.json ] || echo '{}' > /app/tickets.json)
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
CMD curl -fsS "http://localhost:${PORT}/health" || exit 1
CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT:-8000} --workers ${WORKERS:-2}"]