12 lines
438 B
Docker
12 lines
438 B
Docker
FROM node:16-bullseye-slim AS builder
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install --legacy-peer-deps
|
|
COPY . .
|
|
RUN npm run build -- --prod
|
|
|
|
FROM nginx:alpine
|
|
RUN apk add --no-cache gettext # Para o envsubst funcionar
|
|
COPY --from=builder /app/dist/seu-projeto /usr/share/nginx/html
|
|
|
|
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"] |