File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ node_modules
2+ npm-debug.log
3+ dist
4+ .git
5+ .gitignore
6+ README.md
7+ .env
8+ .nyc_output
9+ coverage
10+ .DS_Store
11+ * .log
12+
Original file line number Diff line number Diff line change 1+ FROM node:20-alpine AS builder
2+
3+ WORKDIR /app
4+
5+ COPY package*.json ./
6+ COPY tsconfig.json ./
7+
8+ RUN npm ci
9+
10+ COPY src ./src
11+
12+ RUN npx tsc && cp -r src/assets dist/
13+
14+ FROM node:20-alpine AS production
15+
16+ WORKDIR /app
17+
18+ COPY package*.json ./
19+
20+ RUN npm ci --only=production
21+
22+ COPY --from=builder /app/dist ./dist
23+
24+ EXPOSE 3000
25+
26+ CMD ["node" , "dist/index.js" ]
Original file line number Diff line number Diff line change 1+ .PHONY : help build up down logs restart clean dev docker-build docker-up docker-down
2+
3+ help :
4+ @echo " Comandos disponíveis:"
5+ @echo " make dev - Instala dependências e roda o projeto localmente"
6+ @echo " make build - Constrói a imagem Docker"
7+ @echo " make up - Inicia os containers com docker-compose"
8+ @echo " make down - Para e remove os containers"
9+ @echo " make logs - Mostra os logs do container"
10+ @echo " make restart - Reinicia os containers"
11+ @echo " make clean - Remove containers e imagens Docker"
12+ @echo " make docker-build - Alias para build"
13+ @echo " make docker-up - Alias para up"
14+ @echo " make docker-down - Alias para down"
15+
16+ dev :
17+ npm install
18+ npm run dev
19+
20+ build :
21+ docker-compose build
22+
23+ up :
24+ docker-compose up -d
25+
26+ down :
27+ docker-compose down
28+
29+ logs :
30+ docker-compose logs -f
31+
32+ restart :
33+ docker-compose restart
34+
35+ clean :
36+ docker-compose down -v
37+ docker rmi baas-baas 2> /dev/null || true
38+
39+ docker-build : build
40+
41+ docker-up : up
42+
43+ docker-down : down
44+
Original file line number Diff line number Diff line change 1+ services :
2+ baas :
3+ build :
4+ context : .
5+ dockerfile : Dockerfile
6+ container_name : baas-api
7+ ports :
8+ - " 3000:3000"
9+ restart : unless-stopped
10+ environment :
11+ - NODE_ENV=production
12+
You can’t perform that action at this time.
0 commit comments