.
This commit is contained in:
parent
362ef5983d
commit
c5a7fccc8a
@ -9,7 +9,7 @@ WORKDIR /api
|
||||
# Copiar los archivos de dependencias
|
||||
COPY package.json .
|
||||
COPY tsconfig*.json .
|
||||
RUN yarn install --production
|
||||
RUN yarn install
|
||||
|
||||
RUN mkdir -p ./shared
|
||||
RUN mkdir -p ./server
|
||||
@ -19,15 +19,27 @@ COPY server ./server
|
||||
|
||||
#CMD pwd && ls -la
|
||||
|
||||
RUN cd ./shared && yarn install --production
|
||||
RUN cd ./server && yarn install --production
|
||||
RUN cd ./shared && yarn install
|
||||
RUN cd ./server && yarn install
|
||||
|
||||
# Ejecutar el build
|
||||
# Si hay un error, mostrarlo en detalle.
|
||||
RUN cd ./server && yarn run build || { echo 'Error during build'; exit 1; }
|
||||
|
||||
# FINAL STAGE (Producción)
|
||||
FROM node:lts-iron AS prod
|
||||
|
||||
WORKDIR /api
|
||||
|
||||
# Copiar los archivos del build desde la fase anterior
|
||||
COPY --from=builder /api/shared ./shared
|
||||
COPY --from=builder /api/server ./server
|
||||
|
||||
# Instalar sólo las dependencias de producción en el servidor
|
||||
RUN yarn install --production
|
||||
|
||||
# Exponer el puerto que la API usa
|
||||
EXPOSE 3001
|
||||
|
||||
# Comando para correr la aplicación
|
||||
CMD ["yarn", "run", "server:start"]
|
||||
CMD ["yarn", "run", "server:start"]
|
||||
Loading…
Reference in New Issue
Block a user