forked from streetwriters/notesnook-sync-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
132 lines (122 loc) · 3.03 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
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
version: "3.4"
x-server-discovery:
&server-discovery
NOTESNOOK_SERVER_PORT: 80
NOTESNOOK_SERVER_HOST: notesnook-server
IDENTITY_SERVER_PORT: 80
IDENTITY_SERVER_HOST: identity-server
SSE_SERVER_PORT: 80
SSE_SERVER_HOST: sse-server
SELF_HOSTED: 1
x-env-files:
&env-files
- .env
services:
notesnook-db:
image: mongo
networks:
- notesnook
command: --replSet rs0 --bind_ip_all
# the notesnook sync server requires transactions which only work
# with a MongoDB replica set.
# This job just runs `rs.initiate()` on our mongodb instance
# upgrading it to a replica set. This is only required once but we running
# it multiple times is no issue.
initiate-rs0:
image: mongo
networks:
- notesnook
depends_on:
- notesnook-db
entrypoint: /bin/sh
command:
- -c
- |
mongosh mongodb://notesnook-db:27017 <<EOF
rs.initiate();
rs.status();
EOF
notesnook-s3:
image: minio/minio
ports:
- 9000:9000
- 9090:9090
networks:
- notesnook
volumes:
- ${HOME}/.notesnook/s3:/data/s3
environment:
MINIO_BROWSER: "on"
env_file:
- ./.env.local
command: server /data/s3 --console-address :9090
# There's no way to specify a default bucket in Minio so we have to
# set it up ourselves.
setup-s3:
image: minio/mc
depends_on:
- notesnook-s3
networks:
- notesnook
entrypoint: /bin/sh
env_file: *env-files
command:
- -c
- |
until mc config host add minio http://notesnook-s3:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD; do
sleep 1;
done;
mc mb minio/nn-attachments -p
identity-server:
build:
context: .
dockerfile: ./Streetwriters.Identity/Dockerfile
ports:
- "8264:80"
networks:
- notesnook
env_file: *env-files
depends_on:
- notesnook-db
environment:
<<: *server-discovery
MONGODB_CONNECTION_STRING: mongodb://notesnook-db:27017/identity?replSet=rs0
MONGODB_DATABASE_NAME: identity
notesnook-server:
build:
context: .
dockerfile: ./Notesnook.API/Dockerfile
ports:
- "5264:80"
networks:
- notesnook
env_file: *env-files
depends_on:
- notesnook-s3
- setup-s3
- identity-server
environment:
<<: *server-discovery
MONGODB_CONNECTION_STRING: mongodb://notesnook-db:27017/notesnook?replSet=rs0
MONGODB_DATABASE_NAME: notesnook
S3_INTERNAL_SERVICE_URL: http://notesnook-s3:9000
S3_ACCESS_KEY_ID: "${MINIO_ROOT_USER:-minioadmin}"
S3_ACCESS_KEY: "${MINIO_ROOT_PASSWORD:-minioadmin}"
S3_SERVICE_URL: http://localhost:9000
S3_REGION: us-east-1
sse-server:
build:
context: .
dockerfile: ./Streetwriters.Messenger/Dockerfile
ports:
- "7264:80"
env_file: *env-files
depends_on:
- identity-server
- notesnook-server
networks:
- notesnook
environment:
<<: *server-discovery
networks:
notesnook: