aggiornato il Dockerfile per migliorare la fase di build, aggiungendo comandi di debug per verificare il contenuto delle cartelle
All checks were successful
Deploy / deploy (push) Successful in 23s
All checks were successful
Deploy / deploy (push) Successful in 23s
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,17 +1,22 @@
|
|||||||
# FASE 1: Build (Node.js)
|
# FASE 1: Build
|
||||||
FROM node:lts-alpine as build-stage
|
FROM node:lts-alpine as build-stage
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
COPY . .
|
COPY . .
|
||||||
# Verifica che il comando nel package.json sia "build"
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# FASE 2: Produzione (Nginx)
|
# --- DEBUG ---
|
||||||
|
# Questo comando stampa nei log cosa c'è nella cartella /app
|
||||||
|
RUN echo "CONTENUTO DELLA CARTELLA /app:" && ls -la /app
|
||||||
|
# Questo comando stampa cosa c'è nella cartella di output (dist)
|
||||||
|
# Se la build crea una cartella diversa, qui vedremo l'errore o l'elenco vuoto
|
||||||
|
RUN echo "CONTENUTO DI /app/dist:" && ls -la /app/dist
|
||||||
|
# -------------
|
||||||
|
|
||||||
|
# FASE 2: Produzione
|
||||||
FROM nginx:stable-alpine as production-stage
|
FROM nginx:stable-alpine as production-stage
|
||||||
# Copia la configurazione custom di Nginx (vedi file successivo)
|
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
# Copia i file compilati dalla cartella dist (di solito è /dist)
|
|
||||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
Reference in New Issue
Block a user