-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
28 lines (20 loc) · 967 Bytes
/
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
# This Dockerfile is based on the pattern recommended by the pipenv docs:
# https://pipenv.pypa.io/en/latest/docker.html
FROM python:3.12@sha256:785fef11f44b7393c03d77032fd72e56af8b05442b051a151229145e5fbbcb29 as builder
RUN pip install --no-cache-dir pipenv==2023.12.1
ENV PIPENV_VENV_IN_PROJECT=1
WORKDIR /app
COPY Pipfile Pipfile.lock /app/
RUN pipenv --no-site-packages install -v --deploy
############################################################
FROM python:3.12-slim@sha256:af4e85f1cac90dd3771e47292ea7c8a9830abfabbe4faa5c53f158854c2e819d as final
RUN adduser --uid 19876 summarizer-bot && \
mkdir /app && \
chown summarizer-bot:summarizer-bot /app
USER 19876
# Make sure stdout gets flushed so we see it in the pod logs
ENV PYTHONUNBUFFERED=true
WORKDIR /app
COPY --from=builder --chown=summarizer-bot:summarizer-bot /app/.venv /app/.venv
COPY --chown=summarizer-bot:summarizer-bot *.py /app/
ENTRYPOINT ["/app/.venv/bin/python", "bot.py"]