-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yaml
136 lines (127 loc) · 3.59 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
version: "3.6"
services:
web:
image: nginx
container_name: auth1-nginx
networks:
- subnet
depends_on:
- hydra
- auth1
ports:
- "80:80"
- "6060:6060"
environment:
- NGINX_HOST=localhost
- NGINX_PORT=80
- DEBUG_PORT=6060
- AUTHONE_SERVER=http://auth1:8080
- AUTHONE_DEBUG=http://auth1:6060
- HYDRA_SERVER=http://hydra:4444
volumes:
- ./etc/nginx/default.template:/etc/nginx/conf.d/default.template
command: bin/bash -c "envsubst < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
hydra-migrate:
image: oryd/hydra:v1.0.0-rc.9_oryOS.10
container_name: hydra-migrate
depends_on:
- auth1-postgres
networks:
- subnet
environment:
- LOG_LEVEL=debug
- DSN=postgres://hydra:secret@auth1-postgres/hydra?sslmode=disable
- SYSTEMS_SECRET=newYouReallyNeedToChangeThis youReallyNeedToChangeThis
- SECRETS_COOKIE=newYouReallyNeedToChangeThis youReallyNeedToChangeThis
restart: on-failure
command: "migrate sql postgres://hydra:secret@auth1-postgres/hydra?sslmode=disable"
hydra:
image: oryd/hydra:v1.0.0-rc.9_oryOS.10
container_name: hydra
depends_on:
- hydra-migrate
networks:
- subnet
environment:
- DSN=postgres://hydra:secret@auth1-postgres/hydra?sslmode=disable
- URLS_SELF_ISSUER=http://localhost
- URLS_SELF_PUBLIC=http://localhost
- URLS_CONSENT=http://localhost/oauth2/consent
- URLS_LOGIN=http://localhost/oauth2/login
- URLS_POST_LOGOUT_REDIRECT=http://localhost/oauth2/logout
- LOG_LEVEL=debug
- OAUTH2_HASHERS_BCRYPT_COST=8
- SECRETS_SYSTEM=newYouReallyNeedToChangeThis youReallyNeedToChangeThis
- SECRETS_COOKIE=newYouReallyNeedToChangeThis youReallyNeedToChangeThis
- TTL_ACCESS_TOKEN=3h
- TTL_REFRESH_TOKEN=720h
restart: unless-stopped
command: "serve all --dangerous-force-http"
auth1-mongo:
image: mongo:4.1.3
container_name: auth1-mongo
restart: unless-stopped
ports:
- "27018:27017"
networks:
- subnet
volumes:
- auth1-mongo:/data/db
auth1-postgres:
image: postgres:10.5
container_name: auth1-postgres
restart: unless-stopped
networks:
- subnet
ports:
- "5433:5432"
environment:
- POSTGRES_USER=hydra
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=hydra
volumes:
- auth1-postgres:/data/postgres
auth1-redis:
image: redis:5.0.3
container_name: auth1-redis
restart: unless-stopped
networks:
- subnet
volumes:
- auth1-redis:/data/redis
auth1:
image: golang:1.11.5-stretch
container_name: auth1
restart: unless-stopped
depends_on:
- auth1-mongo
- auth1-redis
- hydra
networks:
- subnet
volumes:
- .:/go/src/auth-one
- $GOPATH/pkg/mod:/go/pkg/mod
working_dir: /go/src/auth-one
command: bash -c "go run main.go migration && go run main.go server"
environment:
- GO111MODULE=on
- AUTHONE_SERVER_PORT=8080
- AUTHONE_DATABASE_HOST=auth1-mongo
- AUTHONE_DATABASE_NAME=auth-one
- AUTHONE_REDIS_ADDRESS=auth1-redis:6379
- AUTHONE_HYDRA_PUBLIC_URL=http://hydra:4444
- AUTHONE_HYDRA_ADMIN_URL=http://hydra:4445
- AUTHONE_SESSION_NETWORK=tcp
- AUTHONE_SESSION_ADDRESS=auth1-redis:6379
- AUTHONE_MIGRATION_DIRECT=up
volumes:
auth1-mongo:
external: true
auth1-redis:
external: true
auth1-postgres:
external: true
networks:
subnet:
external: true