You need to configure individual app before launch/deploy this project.
- Configure client
- You can skip this step when deploy with Docker or Docker Compose
- Configure python-server
- Configure server
If you want to deploy this project with Docker Compose, you need to put all the configuration files inside a folder data
under the repository root.
- create a new folder
data
under this directory, and create following folder structure
./data
├─── python-server
│ └─── config
└─── server
└─── config
You can use following commands to create all of them at once
- Windows
mkdir data\python-server\config
mkdir data\server\config
- MacOS & Linux
mkdir -p data/python-server/config
mkdir -p data/server/config
-
Follow steps from last section to configure server & python-server
-
Finally, put those configuration files into
data
folder, under their dedicated config folder. Note that, all the path in config files are path inside Docker containers, they are not the path in your host system. The template config file ended with.docker
already configure all the path for you.
- You need to create a
.env
file to configure Docker Compose- You can use
.env.template
as your foundation, here is an example:
- You can use
APP_PORT=8080
BACKEND_SERVER="http://localhost:8888"
PYTHON_SERVER="http://localhost:5000"
MR_ENABLE_OPENCV_NONFREE="ON"
APP_PORT
: project application port expose to the public- for reverse proxy deploy only
BACKEND_SERVER
: backend server url, do not add trailing slash /- for normal deploy only
PYTHON_SERVER
: python-server url, do not add trailing slash /- for normal deploy only
MR_ENABLE_OPENCV_NONFREE
: whether to enable MoonRegistration OpenCV non-free registration algorithm (SURF) in the project. Learn more about the flag in this doc
- Build Docker images
- You can use docker-compose file
docker-compose.yml
for normal deployment, this method will create multiple docker containers listenting to multiple ports
docker-compose -f docker-compose.yml build
- You can use docker-compose file
docker-compose-reverse-proxy.yml
for reverse proxy deployment, this method will make the project only listen to one port
docker-compose -f docker-compose-reverse-proxy.yml build
Note: every time you change something you need to rebuild modified app
If you don't want to deploy the project with
python-server
, you can modifydocker-compose.yml
ordocker-compose-reverse-proxy.yml
file, and comment outmoontrek-python-server
section before building.
- Now, you can launch the project with:
- normal deployment
docker-compose -f docker-compose.yml up -d
- reverse proxy deployment
docker-compose -f docker-compose-reverse-proxy.yml up -d
- You can stop the project with:
- normal deployment
docker-compose -f docker-compose.yml down
- reverse proxy deployment
docker-compose -f docker-compose-reverse-proxy.yml down
- Follow the documentation in each app