-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (26 loc) · 842 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
# Use an official Python runtime as a parent image
FROM python:3.11-slim-buster
# Set the working directory in the container
WORKDIR /app
# Add Poetry configuration variables
ENV POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=false \
POETRY_NO_INTERACTION=1 \
PYSETUP_PATH="/app"
# Add Poetry to PATH
ENV PATH="$POETRY_HOME/bin:$PATH"
# Install Poetry
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl \
build-essential \
&& curl -sSL https://install.python-poetry.org | python3 -
# Copy only requirements to cache them in docker layer
WORKDIR $PYSETUP_PATH
COPY ./pyproject.toml ./poetry.lock ./
# Project initialization:
RUN poetry install --only main
# Copy all files
COPY . .
# Run the application:
CMD ["poetry", "run", "python", "fight_me_backend/main.py"]