Files
versions-for-swarm/Dockerfile
seahi e32f5eb803
All checks were successful
continuous-integration/drone/tag Build is passing
fix: 缺少flask依赖
2025-12-17 09:27:16 +08:00

32 lines
688 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM python:3.9-alpine
# 构建参数
ARG APP_VERSION=v1.0
ARG BUGGY=false
# 设置时区
RUN apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
apk del tzdata
ENV TZ=Asia/Shanghai \
APP_VERSION=${APP_VERSION} \
BUGGY=${BUGGY}
WORKDIR /app
RUN pip install flask
# COPY requirements.txt .
# RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
EXPOSE 80
# 添加健康检查v2.0+ 特性)
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost/health || exit 1
CMD ["python", "app.py"]