-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (36 loc) · 1.36 KB
/
Dockerfile
File metadata and controls
51 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Multi-stage build
FROM node:22-alpine AS builder
WORKDIR /app
# Actualizar npm y verificar instalación
RUN npm install -g npm@latest patch-package && npm --version
# Copiar archivos de dependencias
COPY package*.json ./
RUN npm install
# Copiar codigo fuente
COPY . .
# Generar config.js con placeholders para Docker
RUN DOCKER_BUILD=true node scripts/generate-config.mjs
# Build generico (sin variables de entorno)
RUN npm run build
# Etapa final con nginx
FROM nginx:1.27-alpine3.20
LABEL maintainer="PaxaPOS Team"
LABEL version="2.3.0"
LABEL description="Imagen generica de documentacion - Requiere variables de entorno"
# NO definir valores por defecto - DEBEN venir del docker-compose
# Esto asegura que cada deploy tenga su configuracion explicita
ENV BRAND_NAME=""
ENV SYSTEM_URL=""
ENV COMPANY_NAME=""
ENV TZ=America/Argentina/Buenos_Aires
RUN apk update && apk upgrade && apk add --no-cache tzdata
RUN rm -rf /usr/share/nginx/html/*
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Copiar build
COPY --from=builder /app/build /usr/share/nginx/html
# Copiar configuracion de nginx con templates
COPY nginx-runtime.conf /etc/nginx/templates/default.conf.template
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=10s CMD wget --quiet --tries=1 --spider http://localhost:8080/health || exit 1
ENTRYPOINT ["/docker-entrypoint.sh"]