File size: 898 Bytes
2deb2c5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | FROM node:20-bookworm-slim AS frontend
WORKDIR /workspace/frontend
COPY frontend/package.json ./
RUN npm install
COPY frontend ./
RUN npm run build
FROM python:3.11-bookworm
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app/backend \
NEXT_TELEMETRY_DISABLED=1 \
PORT=7860
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
gcc \
g++ \
libpq-dev \
postgresql \
postgresql-contrib \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu torch==2.5.1
RUN pip install --no-cache-dir -r requirements.txt
COPY backend ./backend
COPY scripts ./scripts
COPY --from=frontend /workspace/frontend/out ./backend/app/static
RUN chmod +x /app/scripts/start.sh
EXPOSE 7860
CMD ["/app/scripts/start.sh"]
|