forked from cognitedata/inso-bootstrap-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (21 loc) · 908 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
# gcr.io/distroless/python3-debian11 (runtime env is using 3.9 and that's important for native dependencies)
FROM python:3.9-slim AS builder
WORKDIR /
ENV PYTHONUNBUFFERED=1
# Poetry setup
RUN python3 -m pip install --upgrade pip
RUN pip install poetry
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
RUN pip install --target=/app -r requirements.txt --no-deps
# Keep the same folder structure for imports
COPY incubator/bootstrap_cli/ /app/incubator/bootstrap_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/incubator/bootstrap_cli/__main__.py" ]