From 9a5f77e82c2d1face18b348747cfa2f49480d3b4 Mon Sep 17 00:00:00 2001 From: gabrielm2q Date: Sun, 8 Dec 2024 17:37:37 -0300 Subject: [PATCH] fix(fga-eps-mds/2024.2-ARANDU-DOC#42): modify dockerfile and makefile commands --- Dockerfile | 16 ++++++++++------ Makefile | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index e03a3ab..f72e5ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,22 @@ -FROM node:18 AS base +FROM node:18-alpine AS base + +FROM base AS deps +RUN apk add --no-cache libc6-compat WORKDIR /app -COPY package.json package-lock.json* ./ -RUN \ - if [ -f package-lock.json ]; then npm ci; \ - fi +COPY package.json package-lock.json* ./app/ +RUN npm ci RUN npm install nodemon --save-dev FROM base AS builder WORKDIR /app -RUN npm install COPY . . +RUN npm cache clean --force \ + && npm config set registry http://registry.npmjs.org/ \ + && npm install types-registry \ + && npm install COPY .env .env RUN npm run build diff --git a/Makefile b/Makefile index 04b0859..cdf9cf8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: build build: - npm install && docker-compose build --no-cache + docker-compose build --no-cache .PHONY: start start: @@ -8,7 +8,7 @@ start: .PHONY: run run: - npm install && docker-compose build --no-cache && docker-compose up + docker-compose build --no-cache && docker-compose up .PHONY: stop stop: