===================== Application Base Path ===================== Use case ======== The default installation method assumes your application stack is served behind the `/` path (i.e it has its own domain or subdomain). If you need to serve it behind a subpath (e.g http://your.domain.name/deseasion), you need to setup the frontend so it can correctly redirect the requests and propose the correct requests in its interface and inner workings. Configuration ============= You need to set up nginx so it can redirect the requests correctly. We assume for this example that the subpath is `/deseasion`. Its configuration file is located in `/etc/nginx/conf.d/default.conf`. .. literalinclude:: nginx.conf .. note:: As you may notice, we need to strip the subpath from the backend config. Indeed it only responds to requests on `/api`. You need to pass the base path as `BASE_PATH` option, and the api path as `API_ROOT`, inside the frontend `/frontend/dist/instance/config.json` file. .. literalinclude:: config.json :language: json If you want the swagger to work, you need to also pass the `API_ROOT` path to the `/app/instance/config.py` of the backend container: .. literalinclude:: config.py :language: python Now you need simply to mount your configuration files in the frontend container. Here is how to do it in the `docker-compose.yml`: .. literalinclude:: docker-compose.yml :language: yaml .. warning:: If you mount the `instance/config.py` to `/app/instance/config.py` this way when initializing your application the first time, it will use it verbatim, bypassing the configuration from environment variables. So you better initialize it first with the default installation method, then copy it on your host system and override the proxy config, before changing the `docker-compose.yml`. Otherwise you'll use the default placeholder security settings which is not ideal in a production environment. One way to do it is to simply run the backend container alone with the configuration script: .. code:: bash docker run --rm --entrypoint /app/configure-backend.sh \ -e DB_URI=postgresql://aileron:pass@database/aileron \ -e CELERY_BROKER_URL=redis://redis:6379/0 \ -v ./instance:/app/instance \ registry.gitlab.com/decide.imt-atlantique/deseasion/backend:latest This will create the file `instance/config.py` on your system. You can provide the environment variables for the configuration script with `-e` options.