mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 07:07:21 +00:00
30 lines
476 B
Docker
30 lines
476 B
Docker
FROM node:20 as builder
|
|
|
|
WORKDIR /src/app
|
|
|
|
COPY package*.json ./
|
|
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
|
|
RUN npm run build
|
|
|
|
# Runtime stage
|
|
FROM node:20-alpine
|
|
|
|
RUN apk add --no-cache nginx
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /src/app/dist/apps/auth ./auth
|
|
COPY --from=builder /src/app/dist/apps/backend ./backend
|
|
COPY package*.json ./
|
|
|
|
RUN npm install
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["sh", "-c", "nginx -g 'daemon off;' & node auth/main.js & node backend/main.js"]
|