vuelta a node par aservir frontend
All checks were successful
Workflow de prueba / Build and push images (push) Successful in 1m29s
All checks were successful
Workflow de prueba / Build and push images (push) Successful in 1m29s
This commit is contained in:
@@ -20,19 +20,22 @@ ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
|||||||
# Construimos el bundle
|
# Construimos el bundle
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# 2) Fase de servidor estático
|
# 2) Fase de servidor estático. Tenemos que revisar
|
||||||
# FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
FROM nginx:alpine
|
#FROM nginx:alpine
|
||||||
|
|
||||||
# WORKDIR /app
|
WORKDIR /app
|
||||||
RUN rm -rf /usr/share/nginx/html/*
|
#RUN rm -rf /usr/share/nginx/html/*
|
||||||
|
|
||||||
# Copiamos el build
|
# Copiamos el build
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
#COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
COPY --from=build /app/dist ./dist
|
||||||
|
|
||||||
# Server estático muy simple
|
# Server estático muy simple
|
||||||
# RUN npm install -g serve
|
RUN npm install -g serve
|
||||||
|
|
||||||
EXPOSE 80
|
#EXPOSE 80
|
||||||
|
EXPOSE 4173
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
#CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
CMD ["serve", "-s", "dist", "-l", "4173"]
|
||||||
|
|||||||
Reference in New Issue
Block a user