backend/deploy/Dockerfile

28 lines
551 B
Docker
Raw Normal View History

2022-12-07 20:16:44 +03:00
FROM python:3.9.6-slim-buster
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
RUN pip install poetry==1.2.2
# Configuring poetry
RUN poetry config virtualenvs.create false
# Copying requirements of a project
COPY pyproject.toml poetry.lock /app/src/
WORKDIR /app/src
# Installing requirements
RUN poetry install
# Removing gcc
RUN apt-get purge -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copying actuall application
COPY . /app/src/
RUN poetry install
CMD ["/usr/local/bin/python", "-m", "med_backend"]