-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
34 lines (20 loc) · 863 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
# syntax=docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5
### convert poetry.lock to requirements.txt ###
FROM python:3.10-slim@sha256:af6f1b19eae3400ea3a569ba92d4819a527be4662971d51bb798c923bba30a81 AS poetry
WORKDIR /app
ENV PIP_ROOT_USER_ACTION=ignore
COPY requirements-poetry.txt ./
RUN pip install -r requirements-poetry.txt
COPY pyproject.toml poetry.lock ./
RUN poetry export -f requirements.txt --output requirements.txt
### final image ###
FROM python:3.10-slim@sha256:af6f1b19eae3400ea3a569ba92d4819a527be4662971d51bb798c923bba30a81
WORKDIR /app
ENV PYTHONPATH=/app
COPY --from=poetry /app/requirements.txt ./requirements.txt
ENV PIP_ROOT_USER_ACTION=ignore
RUN pip install -U pip && \
pip install -r requirements.txt
WORKDIR /app
ENTRYPOINT [ "python", "-m", "start_grpc_server" ]
COPY . ./