-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
129 lines (120 loc) · 3.33 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
services:
minio:
image: m.daocloud.io/quay.io/minio/minio
entrypoint:
- sh
command:
- -c
- |-
(
while true; do
mc alias set local http://127.0.0.1:9000 minioadmin minioadmin && break
sleep 2
done
mc mb local/myminio
) &
/usr/bin/docker-entrypoint.sh server /data
ports:
- 9000:9000
container_name: minio
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
init-key:
image: m.daocloud.io/docker.io/alpine/openssl
container_name: init-key
restart: no
entrypoint:
- sh
command:
- -c
- |-
if [ -f /tmp/key/opencidn.key ] && [ -f /tmp/key/opencidn.pub ]; then
echo "Key files already exist, skipping generation"
exit 0
fi
openssl genrsa -out /tmp/key/opencidn.key 2048
openssl rsa -in /tmp/key/opencidn.key -pubout -out /tmp/key/opencidn.pub
# TODO: remove that convert to pkcs1
openssl rsa -in /tmp/key/opencidn.key -out /tmp/key/opencidn.key -traditional
openssl rsa -pubin -in /tmp/key/opencidn.pub -out /tmp/key/opencidn.pub -RSAPublicKey_out
volumes:
- ./key/:/tmp/key/
db-auth:
image: m.daocloud.io/docker.io/library/mysql:9.3.0
container_name: db-auth
restart: unless-stopped
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: auth
swaggerui-auth:
image: m.daocloud.io/docker.io/swaggerapi/swagger-ui:v5.18.2
container_name: swaggerui-auth
restart: unless-stopped
ports:
- 8000:8080
environment:
SWAGGER_JSON_URL: http://localhost:8081/swagger.json
auth:
image: m.daocloud.io/ghcr.io/opencidn/opencidn/auth:v0.0.9
container_name: auth
depends_on:
db-auth:
condition: service_started
init-key:
condition: service_completed_successfully
restart: unless-stopped
ports:
- 8081:8081
command:
- --address=:8081
- --db-url
- root:example@tcp(db-auth:3306)/auth?charset=utf8mb4&parseTime=True
- --token-private-key-file
- /tmp/key/opencidn.key
- --blobs-url
- http://localhost:8090
volumes:
- ./key/:/tmp/key/:ro
gateway:
image: m.daocloud.io/ghcr.io/opencidn/opencidn/gateway:v0.0.9
container_name: gateway
depends_on:
minio:
condition: service_started
ports:
- 8080:8080
command:
- --address=:8080
- --default-registry
- docker.io
- --token-public-key-file
- /tmp/key/opencidn.pub
- --token-url
- http://localhost:8081/auth/token
- --storage-url
- local-minio://minioadmin:minioadmin@myminio.us-east-1?forcepathstyle=true&secure=false&chunksize=104857600®ionendpoint=http://localhost:9000
- --link-expires
- 1m
volumes:
- ./key/:/tmp/key/:ro
agent-1:
image: m.daocloud.io/ghcr.io/opencidn/opencidn/agent:v0.0.9
restart: unless-stopped
depends_on:
minio:
condition: service_started
ports:
- 8090:8090
command:
- --address=:8090
- --token-public-key-file
- /tmp/key/opencidn.pub
- --storage-url
- local-minio://minioadmin:minioadmin@myminio.us-east-1?forcepathstyle=true&secure=false&chunksize=104857600®ionendpoint=http://localhost:9000
- --link-expires
- 1m
volumes:
- ./key/:/tmp/key/:ro