Docker Compose
With the provided Docker Compose file you can instantiate a complete deployment of the uCentral microservices and related components for local development purposes. To spin up a local development environment:
- Switch into the project directory with
cd docker-compose/. - This repository contains a gateway certificate signed by TIP and a self-signed certificate for the REST API and other components which are used by default in the Compose deployment. The certificates are valid for the
*.wlan.localdomain and the Docker Compose uCentral microservice configs useucentral.wlan.localas a hostname, so make sure you add an entry in your hosts file (or in your local DNS solution) which points to127.0.0.1or whatever the IP of the host running the deployment is. Be aware that by default only port15002(websocket) and16003(fileupload) are exposed on all interfaces and the rest only on localhost. Make sure to adapt that according to your needs. - If you have your own certificates and want to use the deployment for anything other than local development copy your certs into the
certs/directory and reference them in the appropriate sections of the microservice configuration files. Make sure to also adapt the sections which reference the hostname. For more information on certificates please see the certificates section of this README and/or CERTIFICATES.md. - Docker Compose pulls the microservice images from the JFrog repository. If you want to change the image tag or some of the image versions which are used for the other services, have a look into the
.envfile. You'll also find service specific.envfiles in this directory. Edit them if you want to change database passwords (highly recommended!) or other configuration data. Don't forget to adapt your changes in the application configuration files. - Open
docker-compose/ucentralgw-data/ucentralgw.propertiesto change authentication data for uCentralGW (again highly recommended!). - Spin up the deployment with
docker-compose up -d. - Add the self-signed certificates to the system trust store of the containers with
./add-ca-cert.sh. - Either add the
certs/restapi-ca.pemcertificate to your trusted browser certificates or add SSL certificate exceptions in your browser by visitinghttps://ucentral.wlan.local:16001andhttps://ucentral.wlan.local:16002(make sure to visit both and add the exceptions). - Connect to your AP via SSH and add a static hosts entry in
/etc/hostsforucentral.wlan.localwhich points to the address of the host the Compose deployment runs on. - Navigate to the UI
http://ucentral.wlan.localand login with your uCentralGW authentication data. - To use the curl test script to talk to the API set the following environment variables:
export UCENTRALSEC="ucentral.wlan.local:16001"
export FLAGS="-s --cacert <your-wlan-cloud-ucentral-deploy-location>/docker-compose/certs/restapi-ca.pem"
The --cacert option is necessary since the REST API certificates are self-signed. Omit the option if you provide your own signed certificates.
PS: The deployment creates local volumes to persist mostly application and database data. In addition to that several bind mounts are created: one for the docker-compose/certs/ directory which is used by multiple services, and the other ones mount service specific data directories and configuration files located under docker-compose/ into the appropriate containers. Be aware that for the bind mounts the host directories and files will be owned by the user in the container. Since the files are under version control, you may have to change the ownership to your user again before pulling changes.