14 lines
493 B
Docker
14 lines
493 B
Docker
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY frontend/package*.json ./
|
|
# Use npm ci when lockfile exists, fallback to npm install
|
|
RUN sh -c 'if [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then npm ci; else npm install; fi'
|
|
COPY frontend/ ./
|
|
RUN npm run build --prefix frontend
|
|
|
|
FROM nginx:stable-alpine
|
|
COPY --from=builder /app/frontend/dist /usr/share/nginx/html
|
|
COPY deploy/nginx/docker-chat.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 8443
|
|
CMD ["nginx", "-g", "daemon off;"]
|