-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
37 lines (26 loc) · 861 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
29
30
31
32
33
34
35
36
37
FROM python:3.11 AS base
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1
WORKDIR /app
# Create virtualenv using poetry lockfile
FROM base AS builder
ENV PIP_NO_CACHE_DIR=off \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.7.1
RUN pip install "poetry==$POETRY_VERSION"
RUN poetry config virtualenvs.in-project true
COPY poetry.lock pyproject.toml /app/
RUN poetry install --only main --no-interaction --no-root
# Create runtime image
FROM python:3.11-slim AS runtime
ARG GITHUB_TOKEN
ENV GITHUB_TOKEN=${GITHUB_TOKEN} \
PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /app
ENV PATH=/app/.venv/bin:$PATH
COPY --from=builder /app/.venv /app/.venv
COPY main.py vvm_versions.py /app/
RUN python3 vvm_versions.py
ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]