-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathDockerfile
33 lines (23 loc) · 870 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
# vim: set filetype=Dockerfile:
FROM python:3.11-slim-buster
ENV POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_NO_INTERACTION=1
# Prepend poetry and venv to path
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
RUN apt-get update && apt-get install --no-install-recommends -y curl default-jre-headless \
&& curl -sSL https://install.python-poetry.org | python
# Update poetry to latest version
RUN poetry self update
WORKDIR /app/example
# Install dependencies
COPY . /app
COPY ./examples/intro/pyproject.toml ./examples/intro/poetry.lock /app/example/
RUN poetry config virtualenvs.create false \
&& poetry install --no-root --no-interaction --no-ansi
# Copy the rest of the application code
COPY ./examples/intro /app/example
# Expose the port that the FastAPI app will listen on
EXPOSE 5001
EXPOSE 5002
CMD ["python"]