forked from henrylle/bia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (19 loc) · 824 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (19 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM public.ecr.aws/docker/library/node:22.22.1-slim
RUN npm install -g npm@11 --loglevel=error
# Instalando curl
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
# Copiar package.json raiz primeiro
COPY package*.json ./
RUN npm install --loglevel=error
# Copiar package.json do client e instalar dependências (incluindo devDependencies para build)
COPY client/package*.json ./client/
RUN cd client && npm install --legacy-peer-deps --loglevel=error
# Copiar todos os arquivos
COPY . .
# Build do front-end com Vite
RUN cd client && VITE_API_URL=http://localhost:3001 npm run build
# Limpeza das dependências de desenvolvimento do client para reduzir tamanho
RUN cd client && npm prune --production && rm -rf node_modules/.cache
EXPOSE 8080
CMD [ "npm", "start" ]