generated from aliyun-computenest/quickstart-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
105 lines (99 loc) · 2.27 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
102
103
104
105
services:
init:
build:
context: .
dockerfile_inline: |
FROM alpine
RUN apk add --no-cache openssl bash uuidgen
COPY ./keygen-init /usr/local/bin
RUN dos2unix /usr/local/bin/keygen-init
RUN chmod +x /usr/local/bin/keygen-init
entrypoint: keygen-init
volumes:
- source: ./
target: /var/keygen
type: bind
setup:
image: keygen/api:latest
environment:
DATABASE_URL: "postgres://postgres:postgres@postgres:5432/keygen"
DISABLE_DATABASE_ENVIRONMENT_CHECK: 1
env_file:
- path: .env
- path: keys.env
required: false
command: setup
depends_on: [ postgres ]
tty: true
stdin_open: true
postgres:
image: postgres:9.6
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: keygen
volumes:
- postgres:/var/lib/postgresql/data
redis:
image: redis
ports:
- "6379:6379"
volumes:
- redis:/data
web:
image: keygen/api:latest
ports:
- "3000:3000"
command: "web"
env_file:
- path: .env
- path: keys.env
required: false
- path: account.env
required: false
environment:
DATABASE_URL: "postgres://postgres:postgres@postgres:5432/keygen"
REDIS_URL: "redis://redis:6379"
KEYGEN_ADMIN_USER: ${KEYGEN_ADMIN_USER}
KEYGEN_ADMIN_PASS: ${KEYGEN_ADMIN_PASS}
volumes:
- keygen:/etc/keygen
links:
- postgres
- redis
worker:
image: keygen/api:latest
command: "worker"
environment:
DATABASE_URL: "postgres://postgres:postgres@postgres:5432/keygen"
REDIS_URL: "redis://redis:6379"
KEYGEN_ADMIN_USER: ${KEYGEN_ADMIN_USER}
KEYGEN_ADMIN_PASS: ${KEYGEN_ADMIN_PASS}
env_file:
- path: .env
- path: keys.env
required: false
volumes:
- keygen:/etc/keygen
links:
- postgres
- redis
caddy:
image: caddy:latest
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
keygen:
postgres:
redis:
caddy_data:
caddy_config: