1- # WARNING: Do not deploy this tutorial configuration directly to a production environment
2- #
3- # The tutorial docker-compose files have not been written for production deployment and will not
4- # scale. A proper architecture has been sacrificed to keep the narrative focused on the learning
5- # goals, they are just used to deploy everything onto a single Docker machine. All FIWARE components
6- # are running at full debug and extra ports have been exposed to allow for direct calls to services.
7- # They also contain various obvious security flaws - passwords in plain text, no load balancing,
8- # no use of HTTPS and so on.
9- #
10- # This is all to avoid the need of multiple machines, generating certificates, encrypting secrets
11- # and so on, purely so that a single docker-compose file can be read as an example to build on,
12- # not use directly.
13- #
14- # When deploying to a production environment, please refer to the Helm Repository
15- # for FIWARE Components in order to scale up to a proper architecture:
16- #
17- # see: https://github.com/FIWARE/helm-charts/
18- #
19- version : " 3.5"
1+ version : ' 3.5'
202services :
21-
223 zookeeper :
234 image : confluentinc/cp-zookeeper:5.4.1
24- container_name : stellio- zookeeper
5+ container_name : zookeeper
256 ports :
267 - 2181:2181
278 environment :
289 ZOOKEEPER_SERVER_ID : 1
2910 ZOOKEEPER_CLIENT_PORT : 2181
3011 ZOOKEEPER_TICK_TIME : 2000
12+
3113 kafka :
3214 image : confluentinc/cp-kafka:5.4.1
33- container_name : stellio- kafka
15+ container_name : kafka
3416 ports :
3517 - 29092:29092
3618 environment :
@@ -43,86 +25,99 @@ services:
4325 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR : 1
4426 depends_on :
4527 - zookeeper
46- neo4j :
47- image : neo4j:4.0
48- container_name : stellio-neo4j
49- volumes :
50- - stellio-neo4j-storage:/data
51- environment :
52- - NEO4J_dbms_allow__upgrade=${NEO4J_ALLOW_UPGRADE}
53- - NEO4J_dbms_default__database=${NEO4J_DEFAULT_DATABASE}
54- - NEO4J_AUTH=neo4j/${NEO4J_PASSWORD}
55- - " NEO4J_dbms_security_procedures_unrestricted=apoc.*"
56- - " NEO4J_dbms_security_procedures_whitelist=apoc.*"
57- - NEO4JLABS_PLUGINS=["apoc"]
58- ports :
59- - 7474:7474
60- - 7687:7687
61- postgres :
62- image : stellio/stellio-timescale-postgis:1.7.2-pg11
63- container_name : stellio-postgres
64- environment :
65- - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
66- - " POSTGRES_MULTIPLE_DATABASES=${STELLIO_SEARCH_DB_DATABASE},${STELLIO_SEARCH_DB_USER},${STELLIO_SEARCH_DB_PASSWORD}: ${STELLIO_SUBSCRIPTION_DB_DATABASE},${STELLIO_SUBSCRIPTION_DB_USER},${STELLIO_SUBSCRIPTION_DB_PASSWORD}"
67- # not sure it is really necessary but it does not break anything ...
68- - PGDATA=/var/lib/postgresql/data/pgdata
69- ports :
70- - 5432:5432
71- volumes :
72- - stellio-postgres-storage:/var/lib/postgresql/data
28+
7329 api-gateway :
7430 container_name : stellio-api-gateway
31+ hostname : stellio
7532 image : stellio/stellio-api-gateway:${STELLIO_DOCKER_TAG}
7633 environment :
77- - SPRING_PROFILES_ACTIVE=${ENVIRONMENT}
34+ - SPRING_PROFILES_ACTIVE=docker
7835 ports :
79- - 8080:8080
36+ - " ${STELLIO_PORT}:8080"
37+
8038 entity-service :
8139 container_name : stellio-entity-service
8240 image : stellio/stellio-entity-service:${STELLIO_DOCKER_TAG}
8341 environment :
84- - SPRING_DATA_NEO4J_PASSWORD=${NEO4J_PASSWORD}
85- - SPRING_PROFILES_ACTIVE=${ENVIRONMENT}
86- - APPLICATION_AUTHENTICATION_ENABLED=${STELLIO_AUTHENTICATION_ENABLED}
42+ - SPRING_PROFILES_ACTIVE=docker
43+ - APPLICATION_AUTHENTICATION_ENABLED=false
8744 ports :
8845 - 8082:8082
8946 depends_on :
9047 - neo4j
9148 - kafka
49+
9250 search-service :
9351 container_name : stellio-search-service
9452 image : stellio/stellio-search-service:${STELLIO_DOCKER_TAG}
9553 environment :
96- - SPRING_PROFILES_ACTIVE=${ENVIRONMENT}
97- - SPRING_R2DBC_URL=r2dbc:postgresql://postgres/${STELLIO_SEARCH_DB_DATABASE}
98- - SPRING_FLYWAY_URL=jdbc:postgresql://postgres/${STELLIO_SEARCH_DB_DATABASE}
99- - SPRING_R2DBC_USERNAME=${STELLIO_SEARCH_DB_USER}
100- - SPRING_R2DBC_PASSWORD=${STELLIO_SEARCH_DB_PASSWORD}
101- - APPLICATION_AUTHENTICATION_ENABLED=${STELLIO_AUTHENTICATION_ENABLED}
54+ - SPRING_PROFILES_ACTIVE=docker
55+ - SPRING_R2DBC_URL=r2dbc:postgresql://postgres/stellio_search
56+ - SPRING_FLYWAY_URL=jdbc:postgresql://postgres/stellio_search
57+ - SPRING_R2DBC_USERNAME=stellio_search
58+ - SPRING_R2DBC_PASSWORD=stellio_search_db_password
59+ - APPLICATION_AUTHENTICATION_ENABLED=false
10260 ports :
10361 - 8083:8083
10462 depends_on :
10563 - postgres
10664 - kafka
65+
10766 subscription-service :
10867 container_name : stellio-subscription-service
10968 image : stellio/stellio-subscription-service:${STELLIO_DOCKER_TAG}
11069 environment :
111- - SPRING_PROFILES_ACTIVE=${ENVIRONMENT}
112- - SPRING_R2DBC_URL=r2dbc:postgresql://postgres/${STELLIO_SUBSCRIPTION_DB_DATABASE}
113- - SPRING_FLYWAY_URL=jdbc:postgresql://postgres/${STELLIO_SUBSCRIPTION_DB_DATABASE}
114- - SPRING_R2DBC_USERNAME=${STELLIO_SUBSCRIPTION_DB_USER}
115- - SPRING_R2DBC_PASSWORD=${STELLIO_SUBSCRIPTION_DB_PASSWORD}
116- - APPLICATION_AUTHENTICATION_ENABLED=${STELLIO_AUTHENTICATION_ENABLED}
70+ - SPRING_PROFILES_ACTIVE=docker
71+ - SPRING_R2DBC_URL=r2dbc:postgresql://postgres/stellio_subscription
72+ - SPRING_FLYWAY_URL=jdbc:postgresql://postgres/stellio_subscription
73+ - SPRING_R2DBC_USERNAME=stellio_subscription
74+ - SPRING_R2DBC_PASSWORD=stellio_subscription_db_password
75+ - APPLICATION_AUTHENTICATION_ENABLED=false
11776 ports :
11877 - 8084:8084
11978 depends_on :
12079 - postgres
12180 - kafka
12281
123- networks :
124- default : ~
82+ # Databases
83+ neo4j :
84+ image : neo4j:4.2
85+ hostname : neo4j
86+ container_name : db-neo4j
87+ volumes :
88+ - neo4j-db:/data
89+ environment :
90+ - NEO4J_dbms_default__database=stellio
91+ - NEO4J_AUTH=none
92+ - " NEO4J_dbms_security_procedures_unrestricted=apoc.*"
93+ - " NEO4J_dbms_security_procedures_allowlist=apoc.*"
94+ - NEO4JLABS_PLUGINS=["apoc"]
95+ ports :
96+ - 7474:7474
97+ - 7687:7687
98+
99+ postgres :
100+ image : stellio/stellio-timescale-postgis:2.3.0-pg13
101+ hostname : postgres
102+ container_name : db-postgres
103+ environment :
104+ - POSTGRES_PASSWORD=password
105+ - " POSTGRES_MULTIPLE_DATABASES=stellio_search,stellio_search,stellio_search_db_password: stellio_subscription,stellio_subscription,stellio_subscription_db_password"
106+ - PGDATA=/var/lib/postgresql/data/pgdata
107+ ports :
108+ - 5432:5432
109+ volumes :
110+ - postgres-db:/var/lib/postgresql/data
125111
112+ # Tutorial connects to the Stellio Broker
113+ tutorial :
114+ environment :
115+ - IOTA_DEFAULT_RESOURCE=/iot/d
116+ - DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT} # Port used by the dummy IOT devices to receive commands
117+ - DUMMY_DEVICES_TRANSPORT=HTTP # Default transport used by dummy Io devices
118+ - DUMMY_DEVICES_PAYLOAD=ULTRALIGHT
119+ - CONTEXT_BROKER=http://api-gateway:${STELLIO_PORT}/ngsi-ld/v1 # URL of the context broker to update context
120+
126121volumes :
127- stellio- neo4j-storage : ~
128- stellio- postgres-storage : ~
122+ neo4j-db : ~
123+ postgres-db : ~
0 commit comments