FROM python:3.11-slim

WORKDIR /app
COPY . .

# Required for mysqlclient + netcat wait
RUN apt-get update && apt-get install -y     gcc     default-libmysqlclient-dev     pkg-config     netcat-openbsd     curl  && rm -rf /var/lib/apt/lists/*

RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# Add entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["flask", "run", "--host=0.0.0.0"]
