-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42d8f42
commit 742f3b6
Showing
4 changed files
with
27 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ Dockerfile | |
|
||
.git | ||
.gitignore | ||
.dockerignore | ||
.dockerignore | ||
|
||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
node_modules | ||
node_modules | ||
|
||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
# FROM --platform=linux/amd64 node:19.2-alpine3.16 | ||
# FROM --platform=$BUILDPLATFORM node:19.2-alpine3.16 | ||
FROM node:19.2-alpine3.16 | ||
|
||
# cd app | ||
# Dependencias de desarrollo | ||
FROM node:19.2-alpine3.16 as deps | ||
WORKDIR /app | ||
|
||
# Dest /app | ||
COPY package.json ./ | ||
|
||
# Instalar las dependencias | ||
RUN npm install | ||
|
||
# Dest /app | ||
# Tests y Build | ||
FROM node:19.2-alpine3.16 as builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
|
||
# Realizar testing | ||
RUN npm run test | ||
|
||
# Eliminar archivos/directorios no necesarios en PROD | ||
RUN rm -rf tests && rm -rf node_modules | ||
|
||
# Unicamente las dependencias de PROD | ||
# Dependencias de producción | ||
FROM node:19.2-alpine3.16 as prod-deps | ||
WORKDIR /app | ||
COPY package.json ./ | ||
RUN npm install --prod | ||
|
||
# Comando run de la imagen | ||
# Ejecutar la App | ||
FROM node:19.2-alpine3.16 as runner | ||
WORKDIR /app | ||
COPY --from=prod-deps /app/node_modules ./node_modules | ||
COPY app.js ./ | ||
COPY tasks/ ./tasks | ||
CMD [ "node", "app.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters