File size: 868 Bytes
c2ddfaf 3fefe3f 1d2a485 3fefe3f c2ddfaf 2a43f18 2570377 c2ddfaf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | FROM python:3.13 as py-builder
WORKDIR /code
COPY ./requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
FROM python:3.13-slim
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y curl procps && rm -rf /var/lib/apt/lists/*
WORKDIR /code
# 每次构建时更新此时间戳以强制刷新缓存
ENV REFRESHED_AT=2025-11-26_04
COPY --from=py-builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
COPY --from=py-builder /usr/local/bin /usr/local/bin
COPY ./main.py .
COPY ./full.txt .
COPY ./short.txt .
COPY ./static ./static
COPY ./update_and_restart.sh .
RUN touch /code/ip_query.log && chmod 777 /code/ip_query.log
RUN chmod -R 777 /code
RUN chmod +x /code/update_and_restart.sh
CMD ["sh", "/code/update_and_restart.sh"]
|