-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
30 lines (24 loc) · 932 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
# to be run with docker compose in smoke-tests directory
FROM python:3.10-slim
WORKDIR /app
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.3.2
# This project is poetic.
RUN pip install "poetry==$POETRY_VERSION"
# This image is single purpose, so we won't need to compartmentalize Py deps in virtualenvs.
RUN poetry config virtualenvs.create false
# Copy the distro into the image and install deps.
COPY README.md pyproject.toml poetry.lock ./
COPY src/ ./src/
RUN poetry install
# Copy the examples into the image and install deps.
COPY examples/ ./examples/
RUN cd ./examples/hello-world-flask && poetry install
# From this point forward, we're operating on the flask example.
WORKDIR /app/examples/hello-world-flask
CMD ["opentelemetry-instrument", "flask", "run", "--host", "0.0.0.0"]