-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-dev.yml
78 lines (78 loc) · 1.99 KB
/
docker-compose-dev.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: "3.9"
services:
client-react-vite:
image: client-react-vite
build:
context: client-react/
dockerfile: Dockerfile.dev
init: true
volumes:
# Bind entire sourcecode (for hot-reloading)
- type: bind
source: ./client-react
target: /usr/src/app/
# Add type=volume with no source and only a target=node_modules
# so efectively overides the above bind mount for this path so node_modules wont be included
- type: volume
target: /usr/src/app/node_modules
# Bind vite.config since file name is not default
- type: bind
source: ./client-react/vite.config.js
target: /usr/src/app/vite.config.dev.js
networks:
- frontend
ports:
- 5173:5173
client-react-nginx:
image: client-react-nginx
build:
context: client-react/
dockerfile: Dockerfile
init: true
networks:
- frontend
ports:
- 80:8080
restart: unless-stopped
api-node:
image: api-node
build:
context: api-node/
dockerfile: Dockerfile
# Would target production as the final stage but we want dev!
target: dev
init: true
volumes:
# Bind entire sourcecode (for hot-reloading)
- type: bind
source: ./api-node
target: /usr/src/app/
# Add type=volume with no source and only a target=node_modules
# so efectively overides the above bind mount for this path so node_modules wont be included
- type: volume
target: /usr/src/app/node_modules
depends_on:
- db
environment:
- DATABASE_URL=postgres://postgres:foobarbaz@db:5432/postgres
networks:
- frontend
- backend
ports:
- 3000:3000
restart: unless-stopped
db:
image: postgres:15.1-alpine
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=foobarbaz
networks:
- backend
ports:
- 5432:5432
volumes:
pgdata:
networks:
frontend:
backend: