FROM python:3.12-slim
# The diagnostics page calls ping, which the slim image does not ship.
RUN apt-get update \
 && apt-get install -y --no-install-recommends iputils-ping \
 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ENV DATABASE=/tmp/helpdesk.db
EXPOSE 5000
#   docker run --rm -p 127.0.0.1:5000:5000 helpdesk
CMD ["flask", "--app", "app:create_app", "run", "--host", "0.0.0.0", "--port", "5000"]
