Skip to content

Commit

Permalink
build: dockerize
Browse files Browse the repository at this point in the history
  • Loading branch information
vanutp committed May 3, 2022
1 parent 4d769da commit f8cb28d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
@@ -0,0 +1,3 @@
.git/
__pycache__
guide/site
26 changes: 26 additions & 0 deletions Dockerfile
@@ -0,0 +1,26 @@
# syntax=docker/dockerfile:1.3
FROM python:3.10-alpine as base
WORKDIR /app

FROM base as builder
RUN apk add --no-cache gcc musl-dev libffi-dev

ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
POETRY_VERSION=1.1.13

RUN --mount=type=cache,target=/root/.cache/pip \
pip install poetry==$POETRY_VERSION
RUN python -m venv /venv

COPY pyproject.toml poetry.lock ./
RUN --mount=type=cache,target=/root/.cache/pip \
poetry export -f requirements.txt | /venv/bin/pip install -r /dev/stdin

FROM base as runner
COPY --from=builder /venv /venv
COPY tgpy tgpy

ENV TGPY_DATA=/data
VOLUME /data

ENTRYPOINT ["/venv/bin/python", "-m", "tgpy"]

0 comments on commit f8cb28d

Please sign in to comment.