forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
104 lines (103 loc) · 2.96 KB
/
docker-compose.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
version: "3.7"
services:
sites-public:
container_name: sites-public
build:
context: .
dockerfile: Dockerfile.sites-public
target: development
volumes:
- ./sites/public:/usr/src/app/sites/public
- /usr/src/app/node_modules
- /usr/src/app/sites/public/node_modules
ports:
# TODO: configure via .env separate from ./sites/public/.env
- "3000:3000"
env_file:
- ./sites/public/.env
environment:
# The URLs are different here because requests made using BACKEND_API_BASE are done from
# the NextJS server, which must address other containers by container name. Requests made
# using INCOMING_HOOK_BODY are done from the client side browser and must use localhost.
BACKEND_API_BASE: "http://backend-core:3100"
INCOMING_HOOK_BODY: "http://localhost:3100"
NEXTJS_PORT: "3000"
command: yarn dev
depends_on:
- backend-core
networks:
- frontend
sites-partners:
container_name: sites-partners
build:
context: .
dockerfile: Dockerfile.sites-partners
target: development
volumes:
- ./sites/partners:/usr/src/app/sites/partners
- /usr/src/app/node_modules
- /usr/src/app/sites/partners/node_modules
ports:
# TODO: configure via .env separate from ./sites/partners/.env
- "3001:3001"
env_file:
- ./sites/partners/.env
environment:
# Using this as the BASE works here because all requests are sent from the client's browser
# (not the NextJS server).
BACKEND_API_BASE: "http://localhost:3100"
NEXTJS_PORT: "3001"
# yarn dev uses a separate node debugger port
command: yarn next -p 3001
depends_on:
- backend-core
networks:
- frontend
backend-core:
container_name: backend-core
build:
context: ./backend/core
target: development
volumes:
- ./backend/core:/usr/src/app
- /usr/src/app/node_modules
ports:
# TODO: configure 3100 via .env separate from ./backend/core/.env
- "3100:3100"
# This is the debug port.
- "9229:9229"
networks:
- frontend
- backend
command: /bin/sh -c "yarn db:migration:run && yarn nest start --debug"
env_file:
- ./backend/core/.env
# Override database connections to point to the container instead of localhost.
environment:
POSTGRES_USER: "postgres"
DATABASE_URL: "postgres://postgres:5432/bloom"
PGUSER: "postgres"
PGPASSWORD: "postgres"
PGDATABASE: "bloom"
depends_on:
- postgres
postgres:
container_name: postgres
image: postgres:13
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "bloom"
PG_DATA: /var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- backend
volumes:
- pgdata:/var/lib/postgresql/data
- /var/run/postgresql:/var/run/postgresql
volumes:
pgdata:
networks:
frontend:
backend: