diff --git a/Makefile b/Makefile index 6178ba7..5343846 100644 --- a/Makefile +++ b/Makefile @@ -146,4 +146,5 @@ sskj-senses: --dbpass $(DB_USR_PASS) deploy-prod-stack: - docker stack deploy -c production.yaml val \ No newline at end of file + - docker network create val-backend + docker stack deploy -c production.yaml val diff --git a/README.md b/README.md index feef3af..9cac95e 100644 --- a/README.md +++ b/README.md @@ -143,4 +143,29 @@ All set, now run the stack. ```bash # From git root $ make deploy-prod-stack -``` \ No newline at end of file +``` + +### 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 /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. diff --git a/nginx.conf b/nginx.conf index 156a27a..4836a4b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -7,6 +7,10 @@ server { root /srv/dist; index index.html index.htm; } + + location /home { + return 301 /; + } } # backend diff --git a/production.yaml b/production.yaml index 2580016..367a77c 100644 --- a/production.yaml +++ b/production.yaml @@ -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: