...
---
version: '3.7'
services:
cnaas_api:
image: docker.sunet.se/cnaas/api:latest
ports:
- 443:1443
networks:
- cnaas
environment:
- GITREPO_TEMPLATES
- GITREPO_SETTINGS
- GITREPO_ETC
- USERNAME_DHCP_BOOT
- PASSWORD_DHCP_BOOT
- USERNAME_DISCOVERED
- PASSWORD_DISCOVERED
- USERNAME_INIT
- PASSWORD_INIT
- USERNAME_MANAGED
- PASSWORD_MANAGED
- FIRMWARE_URL
- TEMPLATE_SECRET_ADMIN_HASH
- TEMPLATE_SECRET_TRANSCEIVER
- TEMPLATE_SECRET_RADIUS
depends_on:
- "cnaas_postgres"
- "cnaas_redis"
- "cnaas_httpd"
volumes:
- type: volume
source: cnaas-templates
target: /opt/cnaas/templates
- type: volume
source: cnaas-settings
target: /opt/cnaas/settings
- type: volume
source: cnaas-jwtcert
target: /opt/cnaas/jwtcert
- type:
volume
source: cnaas-cacert
target: /opt/cnaas/cacert
cnaas_httpd:
image: docker.sunet.se/cnaas/httpd:latest
ports:
- 80:1180
networks:
- cnaas
environment:
- GITREPO_TEMPLATES
cnaas_dhcpd:
image: docker.sunet.se/cnaas/dhcpd:latest
ports:
- 67:67/udp
environment:
- GITREPO_TEMPLATES
- GITREPO_SETTINGS
- GITREPO_ETC
- DB_PASSWORD
- DB_HOSTNAME=cnaas_postgres
- JWT_AUTH_TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpYXQiOjE1NzEwNTk2MTgsIm5iZiI6MTU3MTA1OTYxOCwianRpIjoiNTQ2MDk2YTUtZTNmOS00NzFlLWE2NTctZWFlYTZkNzA4NmVhIiwic3ViIjoiYWRtaW4iLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.Sfffg9oZg_Kmoq7Oe8IoTcbuagpP6nuUXOQzqJpgDfqDq_GM_4zGzt7XxByD4G0q8g4gZGHQnV14TpDer2hJXw"
networks:
- cnaas
cnaas_postgres:
image: docker.sunet.se/cnaas/postgres:latest
volumes:
- cnaas-postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB=cnaas
networks:
- cnaas
cnaas_redis:
image: redis:latest
networks:
- cnaas
networks:
cnaas:
driver: bridge
name: cnaas
ipam:
config:
- subnet: 172.30.0.0/24
driver_opts:
com.docker.network.bridge.name: br-cnaas
volumes:
cnaas-templates:
external: true
cnaas-settings:
external: true
cnaas-postgres-data:
external: true
cnaas-jwtcert:
external: true
cnaas-cacert:
external: true
:latest here should be replaced with specific version or stable once we have a stable release.
...
docker volume create cnaas-postgres-data
docker volume create cnaas-templates
docker volume create cnaas-settings
docker volume create cnaas-jwtcert
docker volume create cnaas-cacert
Start docker-compose and check the logs to try and fix any broken environment variables such as git repositories:
...
docker cp /etc/cnaas-nms/public.pem docker_cnaas_api_1:/opt/cnaas/jwtcert/public.pempe
The API container will also need a rootCA if you want to generate valid certificates for API services on devices, you can create a rootCA via:
docker exec -it docker_cnaas_api_1 /opt/cnaas/createca.sh
Check everything is up and running:
docker ps
docker logs -f docker_cnaas_dhcpd_1
...