21 lines
664 B
Docker
21 lines
664 B
Docker
# Stage 1: Build frontend
|
|
FROM node:20-alpine AS frontend
|
|
WORKDIR /build
|
|
COPY frontend/package*.json ./
|
|
RUN npm install
|
|
COPY frontend/ .
|
|
RUN npm run build
|
|
|
|
# Stage 2: Python backend
|
|
FROM python:3.11-slim
|
|
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
|
WORKDIR /app
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
COPY druppie-sdk/ /tmp/druppie-sdk/
|
|
RUN pip install --no-cache-dir /tmp/druppie-sdk/
|
|
COPY app/ ./app/
|
|
COPY --from=frontend /build/dist ./static/
|
|
EXPOSE 8000
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "--timeout", "300", "--preload", "app:create_app()"]
|