-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (79 loc) · 2.06 KB
/
docker-compose.yml
File metadata and controls
86 lines (79 loc) · 2.06 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
version: "3"
services:
####################### Client Definition #######################
client:
restart: always
container_name: client
build:
context: client
command: ["npm", "run", "serve"]
environment:
HOST: 0.0.0.0
PORT: 3000
volumes:
- ./client/src/:/opt/client/src/
- "/app/node_modules"
ports:
- 3000:3000
depends_on:
- server
networks:
- default
####################### Database Definition #######################
database:
container_name: database
build:
context: database
ports:
- 5435:5432
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=password
- POSTGRES_DB=sample_db
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- default
####################### Server Definition #######################
server:
container_name: server
build:
context: server
volumes:
- "./server:/opt/server/"
ports:
- "5000:5000"
environment:
- FLASK_ENV=development
- APP_SETTINGS=app.config.DevelopmentConfig
- DATABASE_URL=postgres://admin:password@database:5432/sample_db
- DATABASE_TEST_URL=postgres://admin:password@database:5432/sample_db_test
depends_on:
- server-migrate
networks:
- default
####### Server Database Migration Definition ###########
server-migrate:
restart: on-failure
container_name: server-migrate
build:
context: server
command: python manage.py create-db
volumes:
- "./server:/opt/server/"
environment:
- FLASK_ENV=development
- APP_SETTINGS=app.config.Config
- DATABASE_URL=postgres://admin:password@database:5432/sample_db
- DATABASE_TEST_URL=postgres://admin:password@database:5432/sample_db_test
depends_on:
- database
networks:
- default
####################### Networks Definition #######################
networks:
default:
driver: bridge
####################### Volumes Definition #######################
volumes:
postgres-data: