docker配置

This commit is contained in:
ChuXun
2026-01-29 05:57:54 +08:00
parent 9e65266b7e
commit f81af19a0a
7 changed files with 282 additions and 10 deletions

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
GPA_DATA_DIR=/data
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& useradd --create-home --shell /usr/sbin/nologin appuser \
&& mkdir -p /data \
&& chown -R appuser:appuser /app /data
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY monitor.py /app/
USER appuser
CMD ["python", "/app/monitor.py", "--config", "/data/config.ini"]