-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (18 loc) · 840 Bytes
/
Dockerfile
File metadata and controls
30 lines (18 loc) · 840 Bytes
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
FROM python:3.12-slim AS requirements-stage
WORKDIR /tmp
RUN pip install poetry==1.8.2
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
COPY ./pyproject.toml ./poetry.lock* /tmp/
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes --with dev --without metrics
FROM python:3.12-slim AS build-stage
WORKDIR /app
RUN apt update && apt install -y --no-install-recommends make
COPY --from=requirements-stage ./tmp/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY . .
COPY devops-toolbox/scripts/secrets-entrypoint.sh /app/secrets-entrypoint.sh
ENTRYPOINT [ "/app/secrets-entrypoint.sh" ]
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8080"]