forked from kristjan/cjvt-valency
stack config
This commit is contained in:
parent
155c0b2c3d
commit
ef02583d72
3
Makefile
3
Makefile
|
@ -146,4 +146,5 @@ sskj-senses:
|
|||
--dbpass $(DB_USR_PASS)
|
||||
|
||||
deploy-prod-stack:
|
||||
docker stack deploy -c production.yaml val
|
||||
- docker network create val-backend
|
||||
docker stack deploy -c production.yaml val
|
||||
|
|
27
README.md
27
README.md
|
@ -143,4 +143,29 @@ All set, now run the stack.
|
|||
```bash
|
||||
# From git root
|
||||
$ 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.
|
||||
|
|
|
@ -7,6 +7,10 @@ server {
|
|||
root /srv/dist;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /home {
|
||||
return 301 /;
|
||||
}
|
||||
}
|
||||
|
||||
# backend
|
||||
|
|
|
@ -14,24 +14,29 @@ services:
|
|||
MONGO_INITDB_ROOT_PASSWORD: valuserpass
|
||||
volumes:
|
||||
- ${HOME}/mongo_container/data/:/data/db
|
||||
networks:
|
||||
- val-backend
|
||||
|
||||
mongo_express:
|
||||
image: mongo-express
|
||||
restart: always
|
||||
# TODO comment this out
|
||||
ports:
|
||||
- 8087:8081
|
||||
- 8081:8081
|
||||
environment:
|
||||
ME_CONFIG_BASICAUTH_USERNAME: test
|
||||
ME_CONFIG_BASICAUTH_PASSWORD: test
|
||||
ME_CONFIG_MONGODB_ADMINUSERNAME: valadmin
|
||||
ME_CONFIG_MONGODB_ADMINPASSWORD: rolercoaster
|
||||
ME_CONFIG_MONGODB_SERVER: my_mongo
|
||||
networks:
|
||||
- val-backend
|
||||
|
||||
backend_flask:
|
||||
image: backend-flask
|
||||
expose:
|
||||
- 8084
|
||||
networks:
|
||||
- val-backend
|
||||
|
||||
proxy:
|
||||
image: nginx
|
||||
|
@ -41,3 +46,8 @@ services:
|
|||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
- ./src/frontend_vue/dist:/srv/dist
|
||||
networks:
|
||||
- val-backend
|
||||
|
||||
networks:
|
||||
val-backend:
|
||||
|
|
Loading…
Reference in New Issue
Block a user