stack config

This commit is contained in:
voje 2019-05-06 22:10:33 +02:00
parent 155c0b2c3d
commit ef02583d72
4 changed files with 44 additions and 4 deletions

View File

@ -146,4 +146,5 @@ sskj-senses:
--dbpass $(DB_USR_PASS) --dbpass $(DB_USR_PASS)
deploy-prod-stack: deploy-prod-stack:
docker stack deploy -c production.yaml val - docker network create val-backend
docker stack deploy -c production.yaml val

View File

@ -143,4 +143,29 @@ All set, now run the stack.
```bash ```bash
# From git root # From git root
$ make deploy-prod-stack $ make deploy-prod-stack
``` ```
### Uploading a mongo dump
There's a 15GB mongo dump containing the fully processed kres and ssj data.
We can use that file to deploy our aplication.
Check `0.0.0.0:8081` and remove (or backup) the current example database `valdb`.
Run the stack with mongo port mapped:
(uncomment the lines in `production.yaml`)
```yml
ports:
- 27017:27017
```
Run a separate my-mongo container with the mounted data:
```bash
$ mongo run -it --net host -v <local_dump_path>/dumps my-mongo /bin/bash
```
Inside the container (edit the uesrname, password):
```bash
$ mongorestore /dumps/valdb --db valdb --uri=mongodb://valuser:valuserpass@0.0.0.0:27017
```
After uploading, restart the stack with `27017` commented out.

View File

@ -7,6 +7,10 @@ server {
root /srv/dist; root /srv/dist;
index index.html index.htm; index index.html index.htm;
} }
location /home {
return 301 /;
}
} }
# backend # backend

View File

@ -14,24 +14,29 @@ services:
MONGO_INITDB_ROOT_PASSWORD: valuserpass MONGO_INITDB_ROOT_PASSWORD: valuserpass
volumes: volumes:
- ${HOME}/mongo_container/data/:/data/db - ${HOME}/mongo_container/data/:/data/db
networks:
- val-backend
mongo_express: mongo_express:
image: mongo-express image: mongo-express
restart: always restart: always
# TODO comment this out
ports: ports:
- 8087:8081 - 8081:8081
environment: environment:
ME_CONFIG_BASICAUTH_USERNAME: test ME_CONFIG_BASICAUTH_USERNAME: test
ME_CONFIG_BASICAUTH_PASSWORD: test ME_CONFIG_BASICAUTH_PASSWORD: test
ME_CONFIG_MONGODB_ADMINUSERNAME: valadmin ME_CONFIG_MONGODB_ADMINUSERNAME: valadmin
ME_CONFIG_MONGODB_ADMINPASSWORD: rolercoaster ME_CONFIG_MONGODB_ADMINPASSWORD: rolercoaster
ME_CONFIG_MONGODB_SERVER: my_mongo ME_CONFIG_MONGODB_SERVER: my_mongo
networks:
- val-backend
backend_flask: backend_flask:
image: backend-flask image: backend-flask
expose: expose:
- 8084 - 8084
networks:
- val-backend
proxy: proxy:
image: nginx image: nginx
@ -41,3 +46,8 @@ services:
volumes: volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf - ./nginx.conf:/etc/nginx/conf.d/default.conf
- ./src/frontend_vue/dist:/srv/dist - ./src/frontend_vue/dist:/srv/dist
networks:
- val-backend
networks:
val-backend: