forked from hutamatr/todolist-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml.example
52 lines (49 loc) · 1.29 KB
/
docker-compose.yaml.example
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
version: '3.9'
services:
postgresql-backend:
image: postgres:15.1-alpine
container_name: postgresql-backend
restart: always
ports:
- '5432:5432'
environment:
# change env value based on requirement
- 'POSTGRES_USER=example_user'
- 'POSTGRES_DB=example_db'
- 'POSTGRES_PASSWORD=example_password'
volumes:
# change volume location "/example/location" requirement
- /example/location:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
app-backend:
container_name: app-backend
build:
context: '../todolist-backend'
dockerfile: Dockerfile
image: 'backend-todolist:1.0.0'
restart: always
depends_on:
postgresql-backend:
condition: service_healthy
ports:
- '8002:8002'
environment:
- 'DB_HOST_DATABASE=postgresql-backend'
- 'APP_PORT=8002'
app-frontend:
container_name: app-frontend
build:
context: '.'
dockerfile: Dockerfile
image: 'frontend-todolist:1.0.0'
restart: always
ports:
- '3000:3000'
environment:
- 'REACT_APP_NODE_ENV=development'
- 'REACT_APP_BASE_URL=http://127.0.0.1:8002/api/v1'
depends_on:
- app-backend
volumes:
/example/location: