54 lines
1.6 KiB
Docker
54 lines
1.6 KiB
Docker
FROM node:20-slim AS frontend-builder
|
|
|
|
WORKDIR /frontend
|
|
|
|
ENV NODE_ENV=production \
|
|
BACKEND_INTERNAL_URL=http://127.0.0.1:8000 \
|
|
NEXT_PUBLIC_API_BASE=/api
|
|
|
|
COPY frontend/package.json ./
|
|
RUN npm install
|
|
|
|
COPY frontend/app ./app
|
|
COPY frontend/public ./public
|
|
COPY frontend/next-env.d.ts ./next-env.d.ts
|
|
COPY frontend/next.config.js ./next.config.js
|
|
COPY frontend/tsconfig.json ./tsconfig.json
|
|
|
|
RUN npm run build
|
|
|
|
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
NODE_ENV=production
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends curl gnupg supervisor \
|
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
&& apt-get install -y --no-install-recommends nodejs \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY backend/requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY backend/app ./app
|
|
COPY data/branding /app/data/branding
|
|
|
|
COPY --from=frontend-builder /frontend/.next /app/frontend/.next
|
|
COPY --from=frontend-builder /frontend/public /app/frontend/public
|
|
COPY --from=frontend-builder /frontend/node_modules /app/frontend/node_modules
|
|
COPY --from=frontend-builder /frontend/package.json /app/frontend/package.json
|
|
COPY --from=frontend-builder /frontend/next.config.js /app/frontend/next.config.js
|
|
COPY --from=frontend-builder /frontend/next-env.d.ts /app/frontend/next-env.d.ts
|
|
COPY --from=frontend-builder /frontend/tsconfig.json /app/frontend/tsconfig.json
|
|
|
|
COPY docker/supervisord.conf /etc/supervisor/conf.d/magent.conf
|
|
|
|
EXPOSE 3000 8000
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/magent.conf"]
|