-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
27 lines (20 loc) · 906 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
# gcr.io/distroless/python3-debian11 (runtime env is using 3.9 and that's imporatant for native dependencies)
FROM python:3.9-slim AS builder
WORKDIR /
ENV PYTHONUNBUFFERED=1
# Poetry setup
RUN pip3 install poetry==1.8.3
RUN poetry config virtualenvs.create false
COPY poetry.lock .
COPY pyproject.toml .
RUN poetry config virtualenvs.create false
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
RUN pip3 install --target=/app -r requirements.txt --no-deps
# Keep the same folder structure for imports
COPY cognite/transformations_cli/ /app/cognite/transformations_cli/
# A distroless container image with Python and some basics like SSL certificates
# https://github.com/GoogleContainerTools/distroless
FROM gcr.io/distroless/python3-debian11
COPY --from=builder /app /app
ENV PYTHONPATH /app
ENTRYPOINT [ "python", "/app/cognite/transformations_cli/__main__.py" ]