|
|
|
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.11-alpine3.21 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \ |
|
PYTHONUNBUFFERED=1 \ |
|
PIP_NO_CACHE_DIR=1 \ |
|
PIP_DISABLE_PIP_VERSION_CHECK=1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY main.py . |
|
COPY static/ ./static/ |
|
COPY docker-entrypoint.sh . |
|
|
|
|
|
RUN chmod +x docker-entrypoint.sh |
|
|
|
|
|
RUN mkdir -p /app/data && chown 777 /app/data |
|
|
|
|
|
EXPOSE 8000 |
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ |
|
CMD python -c "import requests; requests.get('http://localhost:8000/api')" || exit 1 |
|
|
|
|
|
CMD ["./docker-entrypoint.sh"] |