-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
docker-compose.yaml
101 lines (94 loc) · 2.07 KB
/
docker-compose.yaml
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
services:
setup:
profiles: [ "setup" ]
image: keygen/api:latest
environment:
DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}"
DISABLE_DATABASE_ENVIRONMENT_CHECK: 1
env_file:
- .env
command: >
sh -c "
until pg_isready -h postgres -U ${POSTGRES_USER}; do
echo 'Waiting for PostgreSQL...'
sleep 1
done
bundle exec rails keygen:setup
"
depends_on: [ postgres ]
tty: true
stdin_open: true
postgres:
image: postgres:9.6
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres:/var/lib/postgresql/data
redis:
image: redis
ports:
- "6379:6379"
volumes:
- redis:/data
web:
image: keygen/api:latest
ports:
- "3000:3000"
networks:
- default
- web_network
command: "web"
env_file:
- .env
environment:
DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}"
volumes:
- keygen:/etc/keygen
depends_on:
- postgres
- redis
worker:
image: keygen/api:latest
command: "worker"
env_file:
- .env
environment:
DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}"
volumes:
- keygen:/etc/keygen
depends_on:
- postgres
- redis
caddy:
image: caddy:latest
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
env_file:
- .env
environment:
CADDY_HOSTS: "${CADDY_HOSTS:-$KEYGEN_HOST}"
command: ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]
depends_on:
- web
networks:
- default
- web_network
networks:
web_network:
name: web_network
volumes:
keygen:
postgres:
redis:
caddy_data:
caddy_config: