-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (30 loc) · 1.11 KB
/
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
38
39
40
FROM python:3.11-slim-buster
ARG POETRY_AUTH
ARG CI_COMMIT_SHORT_SHA="-"
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1 \
PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
POETRY_VERSION=1.8.3 \
CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA
RUN apt-get update \
&& apt-get install -y gcc \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p ~/.config/pypoetry/ \
&& echo "${POETRY_AUTH}" > ~/.config/pypoetry/auth.toml \
&& pip install -U "poetry==$POETRY_VERSION" \
&& poetry config virtualenvs.create false \
&& mkdir -p /app
WORKDIR /app
COPY ./poetry.lock ./pyproject.toml ./README.md ./alembic.ini /app/
COPY ./babyhelm /app/babyhelm
COPY ./config /app/local
COPY ./alembic /app/alembic
RUN poetry install --no-interaction --no-ansi
RUN apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 8000
CMD ["poetry", "run", "python", "-m", "babyhelm.app", "--host", "0.0.0.0", "--config", "/app/local/config.dev.yaml", "--log-level", "info"]