Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*
!app.py
!bots/
!bots/**
!Dockerfile
!requirements.txt
25 changes: 18 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
# syntax=docker/dockerfile:1
# syntax=docker/dockerfile:1.7

FROM python:3.10-alpine

ENV PIP_DEFAULT_TIMEOUT=120 \
PIP_DISABLE_PIP_VERSION_CHECK=1

WORKDIR /app
COPY ./bots ./bots
COPY ./app.py ./
COPY requirements.txt ./

RUN set -ex \
&& apk add --no-cache git \
&& python3 -m pip install --upgrade pip \
&& pip install -r requirements.txt
&& apk add --no-cache git

COPY requirements.txt ./

RUN --mount=type=cache,target=/root/.cache/pip \
set -ex; \
for attempt in 1 2 3; do \
python3 -m pip install --retries 10 -r requirements.txt && exit 0; \
if [ "${attempt}" -eq 3 ]; then exit 1; fi; \
echo "pip install failed; retrying (${attempt}/3)"; \
done

COPY ./bots ./bots
COPY ./app.py ./

ENTRYPOINT [ "python", "app.py" ]
Loading