docker配置
This commit is contained in:
23
Dockerfile
Normal file
23
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user