Codeki / Dockerfile
Mayank2027's picture
Update Dockerfile
b34f971 verified
Raw
History Blame Contribute Delete
788 Bytes
FROM python:3.11-slim AS backend
WORKDIR /app
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY backend/ .
COPY data/ /data
FROM node:18-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json ./
RUN npm install --legacy-peer-deps
COPY frontend/ .
RUN npm run build
FROM python:3.11-slim
WORKDIR /app
COPY --from=backend /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=backend /app /app
COPY --from=frontend-build /app/frontend/build /app/static
RUN apt-get update && apt-get install -y git nodejs npm curl && rm -rf /var/lib/apt/lists/*
RUN mkdir /sandbox && chmod 777 /sandbox
ENV PYTHONUNBUFFERED=1
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]