-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
75 lines (71 loc) · 1.8 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
version: '3.7'
services:
db:
image: postgres:9.6
ports:
- 5432:5432
environment:
# Set user/password for Postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# Set a path where Postgres should store the data
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- pgdata:/var/lib/postgresql/data
restart: always
web_init_1:
build:
context: .
dockerfile: Dockerfile
command: ["create"]
environment:
# Set user/password for Postgres
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: "release_admin"
POSTGRES_HOSTNAME: db
DB_SECRET_KEY: ${DB_SECRET_KEY}
NODE_COOKIE: secret
depends_on:
- db
#pretty feeble - which is why I'm now going to create a kubernets config
#https://docs.docker.com/compose/startup-order/
web_init_2:
build:
context: .
dockerfile: Dockerfile
command: ["migrate"]
environment:
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: "release_admin"
POSTGRES_HOSTNAME: db
DB_SECRET_KEY: ${DB_SECRET_KEY}
NODE_COOKIE: secret
depends_on:
- web_init_1
- db
web:
build:
context: .
dockerfile: Dockerfile
command: ["foreground"]
environment:
# Set user/password for Postgres
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOSTNAME: db
POSTGRES_DATABASE: "release_admin"
DB_SECRET_KEY: ${DB_SECRET_KEY}
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
NODE_COOKIE: secret
ports:
- "8080:4000"
restart: always
depends_on:
- db
- web_init_2
# Define the volumes
volumes:
pgdata: