-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
114 lines (113 loc) · 2.75 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
version: "3.3"
services:
postgres:
image: postgres:12
volumes:
- type: volume
source: pgdata
target: /var/lib/postgresql/data
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
develop:
image: rexdb/build:2022.07.26
command: [sleep, infinity]
working_dir: /app
ports:
- ${SYNC_PORT}:22000
volumes:
- type: volume
source: appenv
target: /app
- type: volume
source: appdata
target: /app/data
- type: volume
source: apprun
target: /app/run
- type: volume
source: appdocs
target: /app/doc/build
- type: volume
source: cache
target: /cache
links:
- postgres
environment:
- PATH=/app/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- PGHOST=postgres
- PGUSER=postgres
- npm_config_cache=/cache/npm
- YARN_CACHE_FOLDER=/cache/yarn
- PIP_CACHE_DIR=/cache/pip
- REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
- NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
cap_add:
- NET_ADMIN
sysctls:
net.ipv4.conf.all.route_localnet: 1
nginx:
image: nginx:1.15
command:
- /bin/sh
- -exc
- |
cat > /etc/nginx/conf.d/default.conf <<'EOF'
map $$uri $$app_user {
"~^(/~(?<user>[^/]+))" $$user;
default [email protected];
}
map $$host$$uri $$app_socket {
"~^([^/]+)(/~[^/]+)?(/@(?<app>[^/]+))" /run/app/$$app.socket;
"~^(?<app>[^/]+)\.localhost/" /run/app/$$app.socket;
default /run/app/socket;
}
map $$uri $$app_prefix {
"~^(?<prefix>(/~[^/]+)?(/@[^/]+)?)" $$prefix;
}
map $$uri $$app_path {
"~^(/~[^/]+)?(/@[^/]+)?(?<path>.*)" $$path;
}
server {
listen 80;
server_name .localhost;
location / {
if ($$app_path = "") {
return 302 $$scheme://$$http_host$$uri/;
}
uwsgi_pass unix://$$app_socket;
uwsgi_modifier1 30;
include uwsgi_params;
uwsgi_param SCRIPT_NAME $$app_prefix if_not_empty;
uwsgi_param REMOTE_USER $$app_user if_not_empty;
}
location = /logout {
return 204;
}
location /doc {
alias /var/www/doc/html;
absolute_redirect off;
}
}
EOF
exec nginx -g 'daemon off;'
ports:
- ${HTTP_PORT}:80
volumes:
- type: volume
source: apprun
target: /run/app
- type: volume
source: appdocs
target: /var/www/doc
read_only: true
links:
- develop
volumes:
appenv:
appdata:
apprun:
appdocs:
pgdata:
cache:
external:
name: rexdb-cache