From 34f5a10ef52554ca981a6a6e22eccfa0b4b4ec57 Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Fri, 22 Mar 2024 17:16:28 +0800 Subject: [PATCH] improve Dockerfile --- Dockerfile | 15 +++++++++------ docker-compose.yml.example | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7b6f0a..d3b974b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,10 @@ FROM python:3.12-slim-bullseye +LABEL maintainer="admin@yoursfunny.top" + ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 -COPY requirements.txt . -RUN python -m pip install --no-cache-dir --upgrade -r requirements.txt - -WORKDIR /app -COPY . /app - RUN set -eux; \ apt-get update; \ apt-get install -y gosu; \ @@ -16,6 +12,13 @@ RUN set -eux; \ # verify that the binary works gosu nobody true +WORKDIR /app + +COPY requirements.txt /app +RUN python -m pip install --no-cache-dir --upgrade -r requirements.txt + +COPY . /app + RUN chmod a+x docker-entrypoint.sh ENTRYPOINT ["/app/docker-entrypoint.sh"] diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 3892773..33d935e 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -17,6 +17,6 @@ services: WEBHOOK_CERT: './cert/cert.pem' WEBHOOK_SECRET_TOKEN: 'secret-token' # LOG_LEVEL: 'WARNING' - volumes: - - ./cert:/app/cert +# volumes: +# - ./cert:/app/cert container_name: tgxmb