First configure the proxy, this only needs doing once:
./wodin-deploy configure-proxy dev # or epimodels
./wodin-deploy pull # if needed, pull containers
./wodin-deploy down # if needed, stop existing deployment
./wodin-deploy up # bring up the app
./wodin-deploy configure-proxy none
./wodin-deploy up
Set the API_BRANCH
and APP_BRANCH
environment variables to the names of the branch (or git hash) to deploy
API_BRANCH=mrc-1234 APP_BRANCH=mrc-1237 ./wodin-deploy up
Spin up the odin.api server on a docker private network, then bring up wodin pointing at our configuration directory
docker network create wodin-nw
docker run -d --pull=always --name odin.api --rm \
--network=wodin-nw \
mrcide/odin.api:main
docker run -d --name redis --rm --network=wodin-nw redis:6
docker run -d --pull=always --name wodin --rm \
-p 3000:3000 --network=wodin-nw \
-v $PWD/config:/config:ro \
mrcide/wodin:main /config
The demo app will be available at http://localhost:3000
You can replace branch names on both components as required, but they must be compatible with one another (in terms of the code generated by odin.api and expected by wodin - main
/main
will always work, other combinations are possible).
In a production setting we would not expose port 3000 at all, but add a proxy to this network and expose everything over https.
We can also run wodin on metal, without a docker container, with a few tweaks.
Bring up odin.api much as before, but this time we expose odin.api port to the host
docker run -d --name odin.api --rm \
-p 8001:8001 \
mrcide/odin.api:main
You'll also need a copy of redis, also exposed to the host:
docker run -d --name redis --rm -p 6379:6379 redis:6
Edit the config/wodin.config.json to change the url of the odinAPI
key to be http://127.0.0.1:8001
, and the redisURL
key to be redis://127.0.0.1:6379
{
"courseTitle": "WODIN Example",
"port": 3000,
"appsPath": "apps",
"odinAPI": "http://127.0.0.1:8001",
"redisURL": "redis://127.0.0.1:6379"
}
Then run
npm install
run run serve
The demo app will be available at http://localhost:3000
This requires that the npm package has been updated recently (not currently part of our workflows).
Run
./update-config
to refresh the configuration in /config
with that from the app, but with a sparkly new custom css and logo.