43 lines
1.3 KiB
Docker
43 lines
1.3 KiB
Docker
FROM node:22-bookworm-slim AS frontend-builder
|
|
|
|
WORKDIR /app/frontend
|
|
COPY frontend/package.json frontend/package-lock.json* ./
|
|
RUN npm ci
|
|
COPY frontend ./
|
|
ARG NEXT_PUBLIC_API_URL=
|
|
ARG BACKEND_INTERNAL_URL=http://127.0.0.1:8000
|
|
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
|
ENV BACKEND_INTERNAL_URL=$BACKEND_INTERNAL_URL
|
|
RUN npm run build
|
|
|
|
FROM python:3.12-slim-bookworm
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV NODE_ENV=production
|
|
ENV HOSTNAME=0.0.0.0
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ca-certificates ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=frontend-builder /usr/local/bin/node /usr/local/bin/node
|
|
COPY --from=frontend-builder /usr/local/bin/npm /usr/local/bin/npm
|
|
COPY --from=frontend-builder /usr/local/bin/npx /usr/local/bin/npx
|
|
COPY --from=frontend-builder /usr/local/lib/node_modules /usr/local/lib/node_modules
|
|
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY backend ./backend
|
|
COPY scripts ./scripts
|
|
COPY --from=frontend-builder /app/frontend/.next ./frontend/.next
|
|
COPY --from=frontend-builder /app/frontend/package.json ./frontend/package.json
|
|
COPY --from=frontend-builder /app/frontend/node_modules ./frontend/node_modules
|
|
|
|
EXPOSE 3000
|
|
CMD ["bash", "scripts/start-coolify.sh"]
|