-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (25 loc) · 1.37 KB
/
Dockerfile
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
31
32
33
34
35
36
37
FROM python:3.11-slim-bullseye AS build-venv
WORKDIR /app
COPY requirements.txt .
#RUN python3.11 -m venv venv && \
# venv/bin/pip3.11 install --upgrade pip setuptools wheel && \
# venv/bin/pip3.11 install --disable-pip-version-check --no-cache-dir gunicorn[gevent] && \
# venv/bin/pip3.11 install --disable-pip-version-check --no-cache-dir -r requirements.txt
RUN pip3.11 install --upgrade pip setuptools wheel && \
pip3.11 install --disable-pip-version-check --no-warn-script-location --no-cache-dir --user gunicorn[gevent] && \
pip3.11 install --disable-pip-version-check --no-warn-script-location --no-cache-dir --user -r requirements.txt
#FROM gcr.io/distroless/python3-debian11:debug
#FROM python:3.11-alpine
FROM python:3.11-slim-bullseye
LABEL maintainer="yuangezhizao <root@yuangezhizao.cn>"
#COPY --from=build-venv /app/venv /app/venv
COPY --from=build-venv /root/.local /root/.local
WORKDIR /app
COPY . /app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
#ENV PATH=/app/venv/bin:$PATH
ENV PATH=/root/.local/bin:$PATH
EXPOSE 5000
HEALTHCHECK --timeout=10s --interval=30s --retries=3 CMD curl http://localhost:5000 || exit 1
CMD ["gunicorn", "--worker-class", "gevent", "--workers", "8", "--bind", "0.0.0.0:5000", "--pythonpath", "/app/src", "wacca_probe:create_app()", "--max-requests", "10000", "--timeout", "5", "--keep-alive", "5", "--log-level", "info"]