update Dockerfile
This commit is contained in:
parent
5574264368
commit
09b37fa1a8
@ -1,12 +1,25 @@
|
||||
FROM python:3.11-slim-bookworm
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
# BUILD
|
||||
FROM python:3.11-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY requirements.txt requirements.txt
|
||||
|
||||
RUN pip3 install -r requirements.txt
|
||||
COPY app/. .
|
||||
COPY app/requirements.txt .
|
||||
RUN pip install --prefix=/install --no-cache-dir -r requirements.txt
|
||||
|
||||
CMD ["gunicorn", "-w", "4", "wsgi:app", "--bind", "0.0.0.0:8000"]
|
||||
# FINAL
|
||||
FROM python:3.11-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache libffi openssl rsync curl hugo python3 py3-pip
|
||||
|
||||
COPY --from=builder /install /usr/local
|
||||
COPY app/ /app
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache libffi openssl rsync curl
|
||||
|
||||
EXPOSE 5000
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 CMD curl -f http://localhost:5000/ || exit 1
|
||||
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "main:app"]
|
||||
Loading…
x
Reference in New Issue
Block a user