File size: 793 Bytes
703a33a b901d2c 703a33a b901d2c 703a33a b901d2c | 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 | FROM node:20-alpine AS frontend-builder
WORKDIR /workspace
COPY app/frontend/package*.json ./app/frontend/
RUN cd app/frontend && npm ci
COPY app/frontend ./app/frontend
RUN cd app/frontend && npm run build
FROM python:3.11-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PORT=7860 \
DEMO_MODE=true
WORKDIR /workspace
RUN adduser --disabled-password --gecos "" --uid 1000 appuser
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY start.sh .
COPY app/backend ./app/backend
COPY app/data ./app/data
COPY app/public ./app/public
COPY --from=frontend-builder /workspace/app/frontend/dist ./app/frontend/dist
RUN chmod +x /workspace/start.sh && chown -R 1000:1000 /workspace
USER 1000
EXPOSE 7860
CMD ["/workspace/start.sh"]
|