Digit-Classifier / Dockerfile
abdurafay19's picture
Update Dockerfile
73f2e69 verified
Raw
History Blame Contribute Delete
806 Bytes
FROM python:3.10-slim
# System deps
RUN apt-get update && \
apt-get install -y curl build-essential gnupg && \
rm -rf /var/lib/apt/lists/*
# Node + pnpm
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
npm install -g pnpm
ENV PATH="/root/.local/share/pnpm:${PATH}"
WORKDIR /app
# Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Frontend deps
COPY UI/package.json UI/pnpm-lock.yaml ./UI/
WORKDIR /app/UI
RUN pnpm install --frozen-lockfile
# Source code (changes most often)
WORKDIR /app
COPY main.py model.py ./
COPY UI ./UI
# Build frontend
WORKDIR /app/UI
RUN pnpm build
EXPOSE 8000 7860
CMD sh -c "cd /app && uvicorn main:app --host 0.0.0.0 --port 8000 & cd /app/UI && pnpm start -p 7860"