up
This commit is contained in:
+17
-11
@@ -1,17 +1,23 @@
|
||||
# ---- Build stage ----
|
||||
FROM node:22-alpine AS build
|
||||
|
||||
# ---- Frontend build ----
|
||||
FROM node:22-alpine AS frontend-build
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
COPY package.json pnpm-lock.yaml .npmrc ./
|
||||
RUN corepack enable && corepack prepare pnpm@10 --activate && pnpm install
|
||||
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
|
||||
# ---- Serve stage ----
|
||||
FROM nginx:alpine
|
||||
# ---- Backend runtime ----
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends gcc \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
EXPOSE 3015
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
COPY backend/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY backend/ .
|
||||
COPY --from=frontend-build /app/dist ./dist
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
|
||||
Reference in New Issue
Block a user