improve Dockerfile

This commit is contained in:
2024-03-22 17:17:22 +08:00
parent 7518ced01f
commit 34f5a10ef5
2 changed files with 11 additions and 8 deletions
+9 -6
View File
@@ -1,14 +1,10 @@
FROM python:3.12-slim-bullseye FROM python:3.12-slim-bullseye
LABEL maintainer="admin@yoursfunny.top"
ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=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; \ RUN set -eux; \
apt-get update; \ apt-get update; \
apt-get install -y gosu; \ apt-get install -y gosu; \
@@ -16,6 +12,13 @@ RUN set -eux; \
# verify that the binary works # verify that the binary works
gosu nobody true 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 RUN chmod a+x docker-entrypoint.sh
ENTRYPOINT ["/app/docker-entrypoint.sh"] ENTRYPOINT ["/app/docker-entrypoint.sh"]
+2 -2
View File
@@ -17,6 +17,6 @@ services:
WEBHOOK_CERT: './cert/cert.pem' WEBHOOK_CERT: './cert/cert.pem'
WEBHOOK_SECRET_TOKEN: 'secret-token' WEBHOOK_SECRET_TOKEN: 'secret-token'
# LOG_LEVEL: 'WARNING' # LOG_LEVEL: 'WARNING'
volumes: # volumes:
- ./cert:/app/cert # - ./cert:/app/cert
container_name: tgxmb container_name: tgxmb