-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
63 lines (61 loc) · 1.71 KB
/
docker-compose.dev.yml
File metadata and controls
63 lines (61 loc) · 1.71 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
services:
api:
build: .
container_name: bolsa-api-nest-dev
command: sh -c "npx prisma generate && npx prisma migrate deploy && npx prisma db seed && pnpm run start:dev"
working_dir: /usr/src/app
tty: true
stdin_open: true
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://user:bolsa2024!@db:5432/bolsa_sim?schema=public
# garante que o watcher do chokidar funcione no Windows + Docker Desktop
- CHOKIDAR_USEPOLLING=true
- CHOKIDAR_INTERVAL=300
volumes:
# monta o projeto no container (reload instantâneo)
- ./:/usr/src/app:cached
# evita conflito de node_modules host ↔ container
- /usr/src/app/node_modules
depends_on:
db:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:15
container_name: bolsa-db-dev
restart: unless-stopped
ports:
- "5433:5432"
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: bolsa2024!
POSTGRES_DB: bolsa_sim
volumes:
- pgdata_dev:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d bolsa_sim"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
prisma-studio:
build: .
container_name: bolsa-prisma-studio-dev
command: npx prisma studio --hostname 0.0.0.0
working_dir: /usr/src/app
ports:
- "5555:5555"
environment:
- DATABASE_URL=postgresql://user:bolsa2024!@db:5432/bolsa_sim?schema=public
volumes:
- ./:/usr/src/app:cached
- /usr/src/app/node_modules
depends_on:
db:
condition: service_healthy
restart: unless-stopped
volumes:
pgdata_dev: