digit-classifier / Dockerfile
LeoAmir's picture
Update Dockerfile
0efd3be
Raw History Blame Contribute Delete
485 Bytes
# syntax=docker/dockerfile:1
FROM python:3.10-slim
WORKDIR /app
COPY backend/requirements.txt .
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
&& pip install --no-cache-dir -r requirements.txt
COPY backend ./backend
COPY frontend ./frontend
# ensure model dir exists and train the model during build
RUN mkdir -p model
RUN python backend/train.py
ENV PORT=7860
ENV TF_CPP_MIN_LOG_LEVEL=2
CMD ["uvicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "7860"]