You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.3 KiB

# PREPARE
## Base setup
- `mkdir letsencrypt nginx_conf.d postgres_data`
- put site repo into ./treeralker
- put treetalker.guideget.ru.conf nginx config into ./nginx_conf.d
- put `pg_dumpall --clean | gzip > db.out.gz` into ./init_db
- fix treetalker/nodejs/config/config.env `HOST=` db address
- replace `SERVER_IP_OR_DOMAIN` in tt-parse-service.js and vector-layers-data.js
- fix treetalker.guideget.ru.conf:
- replace `proxy_pass http://localhost..` directives with container routing
- replace `location /ppga {...}` block with
```nginx
location /ppga/ {
proxy_pass http://ppga:8080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
access_log /var/log/nginx/ppga.access.log;
}
```
- add `location` block
```nginx
location /martin/ {
proxy_pass http://martin:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
```
## Clean up
- delete ./node_modules dirs
- delete react release ./build dir
- remove `default_server` directive from treetalker.guideget.ru.conf
## Dev setup
- put options-ssl-nginx.conf into ./letsencrypt
- replace `$host` entries in treetalker.guideget.ru.conf with your develoment host
- replace `treetalker.guideget.ru` in source with your develoment host
## Prod setup
- disable `USE_LOCAL_CA=1`
- put real certs in ./letsencrypt
- remove "1000:443" mapping
- uncomment 80, 443 port mappings
- put real password for postgres in `POSTGRES_PASSWORD` and `DATABASE_URL`
# Prepaired archive
- `curl --location --remote-name https://iamonlyherefortheicecream.ml/docker-treetalker.tar.gz`
- `tar --extract --file treetalker.tar.gz`
- replace `SERVER_IP_OR_DOMAIN` in ./treetalker/src/services/tt-parse-service.js and ./treetalker/src/components/map-page/vector-layers/vector-layers-data.js
- put real passwords in docker-compose.yml
# RUN
`docker-compose build`
(watch out for 'npm WARN tar ENOENT: no such file or directory' **intermitent** failure https://github.com/npm/cli/issues/2319 et al.)
`docker-compose up -d`