The directory contains docker-composer files allowing to set up environment.
- flashcards-db (postgres). it is requires by :db-pg
- flashcards-keycloak. Authorization (demo:demo).
- flashcards-nats (transport)
- flashcards-redis (cache)
- flashcards-tts-server
- flashcards-cards-server
- flashcards-dictionaries-server
- flashcards-app
- elasticsearch,
- logstash
- kibana
kafka
andkafdrop
URLs:
- kafdrop: http://localhost:9000/
- kibana: http://localhost:5601/
- elasticsearch: http://localhost:9200/
- keycloak: http://localhost:8081/
- rabbitmq: http://localhost:15672/
- application: http://localhost:8080/
Build tts-server & cards-server & dictionaries-server & app images (see build-images
script):
docker rm tutor-deploy-flashcards-tts-server-1
docker rm tutor-deploy-flashcards-cards-server-1
docker rm tutor-deploy-flashcards-dictionaries-server-1
docker rm tutor-deploy-flashcards-app-1
docker rmi sszuev/open-tutor-tts-server:2.0.0-snapshot
docker rmi sszuev/open-tutor-cards-server:2.0.0-snapshot
docker rmi sszuev/open-tutor-dictionaries-server:2.0.0-snapshot
docker rmi sszuev/open-tutor:2.0.0-snapshot
cd ..
gradle clean build -x test
cd ./app-tts
gradle dockerBuildImage
cd ../app-cards
gradle dockerBuildImage
cd ../app-dictionaries
gradle dockerBuildImage
cd ../app-ktor
gradle dockerBuildImage
cd ../tutor-deploy
Example commands to deploy environment:
docker-compose -f docker-compose-app.yml up flashcards-db flashcards-keycloak flashcards-nats
docker-compose -f docker-compose-app.yml up flashcards-tts-server flashcards-dictionaries-serve flashcards-cards-server flashcards-app
docker-compose -f docker-compose-elk-stack.yml -p flashcards-elk-stack up
- generate self-signed certificates:
mkdir tutor-deploy/data/envoy/certs
cd tutor-deploy/data/envoy/certs
openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.crt -days 365 -subj "/CN=localhost"
chmod 644 server.crt server.key
- configure envoy.yml:
- set
port_value: 443
issuer: "https://localhost/realms/flashcards-realm"
- under
filters
add following section:
- filters
...
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "/etc/envoy/certs/server.crt"
private_key:
filename: "/etc/envoy/certs/server.key"
- change docker-compose-app.yml:
- for
flashcards-keycloak:
KC_HOSTNAME_URL: "https://localhost/"
&KC_HOSTNAME_ADMIN_URL: "https://localhost/"
&KC_HOSTNAME_PORT: "443"
- for flashcards-envoy:
ports: - "443:443"
& uncomment- "${DATA_DIR}/envoy/certs:/etc/envoy/certs"
- for
flashcards-app
KEYCLOAK_AUTHORIZE_ADDRESS: "https://localhost"
&KEYCLOAK_REDIRECT_ADDRESS: "https://localhost"
docker-compose -f docker-compose-app.yml up
- go to
https://localhost/admin/master/console
->flashcards-realm
->flashcards-client
- set
redirect url
tohttps://localhost/*
- the application should be available via
https://localhost/