Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Latest commit

 

History

History
88 lines (59 loc) · 2.47 KB

old_readme.md

File metadata and controls

88 lines (59 loc) · 2.47 KB

Refs



Istruzioni



docker deploy

$ docker compose up -d
Creating network "nginx-flask-mongo_default" with the default driver
Pulling mongo (mongo:)...
latest: Pulling from library/mongo
423ae2b273f4: Pull complete
...
...
Status: Downloaded newer image for nginx:latest
Creating nginx-flask-mongo_mongo_1 ... done
Creating nginx-flask-mongo_backend_1 ... done
Creating nginx-flask-mongo_web_1     ... done

Expected result

Listing containers must show three containers running and the port mapping as below:

$ docker ps
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                  NAMES
a0f4ebe686ff        nginx                       "/bin/bash -c 'envsu…"   About a minute ago   Up About a minute   0.0.0.0:80->80/tcp     nginx-flask-mongo_web_1
dba87a080821        nginx-flask-mongo_backend   "./server.py"            About a minute ago   Up About a minute                          nginx-flask-mongo_backend_1
d7eea5481c77        mongo                       "docker-entrypoint.s…"   About a minute ago   Up About a minute   27017/tcp              nginx-flask-mongo_mongo_1

top and remove the containers

$ docker compose down


virtualenv python

  • Tested on ubuntu 20.04
  • Nota: dobbiamo esporre mongodb in locale su porta 27017, oppure lasciamo docker di prima accesi e forwardiamo traffico così 127.0.0.1:27017 -> 27017:nginx -> 27017:nginx-flask-mongo_backend
rm -rf object_virtualenv
mkdir object_virtualenv 
virtualenv --python=python3 object_virtualenv
source object_virtualenv/bin/activate

# some issue with install sorry, instead you need to install manually packages
cd src
python -m pip install -r requirements.txt

python server.py --host 127.0.0.1 --mongo_ip 127.0.0.1 --debug