-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-cd.yml
More file actions
88 lines (81 loc) · 2.41 KB
/
docker-compose-cd.yml
File metadata and controls
88 lines (81 loc) · 2.41 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
87
88
version: "3"
services:
####################### Client Definition #######################
client:
image: client:${GIT_COMMIT:-latest}
container_name: client
build:
context: client
command: ["npm", "run", "start"]
environment:
HOST: 0.0.0.0
PORT: 3000
volumes:
- ./client/src/:/opt/client/src/
- "/app/node_modules"
ports:
- 80:3000
networks:
- default
####################### Database Definition #######################
database:
image: database:${GIT_COMMIT:-latest}
container_name: database
build:
context: database
ports:
- 5432:5432
environment:
- POSTGRES_USER=${POSTGRES_USER:-admin}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
- POSTGRES_DB=postgres
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- default
####################### Server Definition #######################
server:
image: server:${GIT_COMMIT:-latest}
container_name: server
build:
context: server
volumes:
- "./server:/opt/server/"
ports:
- "5000:5000"
environment:
- FLASK_ENV=development
- DATABASE_URL=postgres://${POSTGRES_USER:-admin}:${POSTGRES_PASSWORD:-password}@database:5432/postgres
- DATABASE_TEST_URL=postgres://${POSTGRES_USER:-admin}:${POSTGRES_PASSWORD:-password}@database:5432/postgres_test
- SMTP_USERNAME=${SMTP_USERNAME:-user}
- SMTP_PASSWORD=${SMTP_PASSWORD:-pass}
- SMTP_ENABLE=${SMTP_ENABLE:-True}
depends_on:
- server-migrate
networks:
- default
####### Server Database Migration Definition ###########
server-migrate:
restart: on-failure
image: server-migrate:${GIT_COMMIT:-latest}
container_name: server-migrate
build:
context: server
command: python manage.py create-db
volumes:
- "./server:/opt/server/"
environment:
- FLASK_ENV=development
- DATABASE_URL=postgres://${POSTGRES_USER:-admin}:${POSTGRES_PASSWORD:-password}@database:5432/postgres
- DATABASE_TEST_URL=postgres://${POSTGRES_USER:-admin}:${POSTGRES_PASSWORD:-password}@database:5432/postgres_test
depends_on:
- database
networks:
- default
####################### Networks Definition #######################
networks:
default:
driver: bridge
####################### Volumes Definition #######################
volumes:
postgres-data: