FROM python:3.8-slim-buster

WORKDIR /app
RUN python3 -m venv venv
RUN . venv/bin/activate
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

# Debug image reusing the base
# Install dev dependencies for debugging
RUN pip install debugpy
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1

COPY . .
ENV FLASK_ENV=development
# ENTRYPOINT ["python3"]
CMD ["python3", "-m", "app"]
# For start Jakub version run script
# CMD ["python3", "-m", "flask", "run", "-h", "0.0.0.0", "-p", "5000" ]

# , "-m", "debugpy", "--listen", "0.0.0.0:5678", "-m", "app",  "--wait-for-client", "--multiprocess",