-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Lukinhasssss/feature/authentication-with-…
…keycloak Automated PR from feature/authentication-with-keycloak
- Loading branch information
Showing
28 changed files
with
326 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
SPRING_PROFILES_ACTIVE=development | ||
SPRING_PROFILES_ACTIVE=production | ||
|
||
ELASTICSEARCH_URIS=http://localhost:9200 | ||
ELASTICSEARCH_USERNAME=elastic | ||
ELASTICSEARCH_PASSWORD=changeme | ||
|
||
KEYCLOAK_REALM=codeflix | ||
KEYCLOAK_HOST=http://localhost:18080 | ||
KEYCLOAK_HOST=http://keycloak.internal:8443 | ||
KEYCLOAK_CLIENT_ID=admin-do-catalogo | ||
KEYCLOAK_CLIENT_SECRET=AMs8T4dChEF5KCgRZiYP2nAsQVgm4MUy | ||
|
||
BASE_URL=http://localhost:8080 | ||
|
||
KAFKA_BOOTSTRAP_SERVERS=localhost:9092 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
name: catalogo-de-videos | ||
|
||
services: | ||
catalogo-de-videos: | ||
container_name: catalogo-de-videos | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
# image: lukinhasssss/catalogo-de-videos | ||
ports: | ||
- "8081:8081" | ||
restart: on-failure | ||
depends_on: | ||
kafka-catalogo-de-videos: | ||
condition: service_healthy | ||
env_file: | ||
- .env | ||
labels: | ||
filebeat_collector: true | ||
networks: | ||
- catalogo-de-videos | ||
- kafka-catalogo-de-videos | ||
- keycloak-codeflix | ||
- elasticsearch-codeflix | ||
|
||
zookeeper-catalogo-de-videos: | ||
container_name: zookeeper-catalogo-de-videos | ||
image: confluentinc/cp-zookeeper:latest | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
healthcheck: | ||
test: [ "CMD", "zookeeper-shell", "localhost:2181", "ls", "/" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 3 | ||
networks: | ||
- kafka-catalogo-de-videos | ||
|
||
kafka-catalogo-de-videos: | ||
container_name: kafka-catalogo-de-videos | ||
image: confluentinc/cp-kafka:latest | ||
depends_on: | ||
zookeeper-catalogo-de-videos: | ||
condition: service_healthy | ||
ports: | ||
- "9092:9092" | ||
- "9094:9094" | ||
environment: | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper-catalogo-de-videos:2181 | ||
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | ||
KAFKA_LISTENERS: INTERNAL://:9092,OUTSIDE://:9094 | ||
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-catalogo-de-videos:9092,OUTSIDE://localhost:9094 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT | ||
volumes: | ||
- kafka-catalogo-de-videos:/var/lib/kafka/data | ||
healthcheck: | ||
test: [ "CMD", "nc", "-z", "localhost", "9092" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 3 | ||
networks: | ||
- kafka-catalogo-de-videos | ||
|
||
control-center-catalogo-de-videos: | ||
container_name: control-center-catalogo-de-videos | ||
image: confluentinc/cp-enterprise-control-center:6.0.1 | ||
hostname: control-center | ||
depends_on: | ||
kafka-catalogo-de-videos: | ||
condition: service_healthy | ||
ports: | ||
- "9021:9021" | ||
environment: | ||
CONTROL_CENTER_BOOTSTRAP_SERVERS: kafka-catalogo-de-videos:9092 | ||
CONTROL_CENTER_ZOOKEEPER_CONNECT: zookeeper-catalogo-de-videos:2181 | ||
CONTROL_CENTER_REPLICATION_FACTOR: 1 | ||
CONTROL_CENTER_CONNECT_CLUSTER: http://kafka-connect-catalogo-de-videos:8083 | ||
PORT: 9021 | ||
healthcheck: | ||
test: [ "CMD", "nc", "-z", "localhost", "9021" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 3 | ||
networks: | ||
- kafka-catalogo-de-videos | ||
|
||
kafka-connect-catalogo-de-videos: | ||
container_name: kafka-connect-catalogo-de-videos | ||
image: confluentinc/cp-kafka-connect-base:6.0.1 | ||
ports: | ||
- "8083:8083" | ||
environment: | ||
CONNECT_BOOTSTRAP_SERVERS: kafka-catalogo-de-videos:9092 # Tive que adicionar o host no arquivo /etc/hosts para que a aplicacao conseguisse acessar corretamente | ||
CONNECT_REST_PORT: 8083 | ||
CONNECT_GROUP_ID: kafka-connect-catalogo-de-videos | ||
CONNECT_REST_ADVERTISED_HOST_NAME: "kafka-connect-catalogo-de-videos" | ||
CONNECT_CONFIG_STORAGE_TOPIC: _connect-configs | ||
CONNECT_OFFSET_STORAGE_TOPIC: _connect-offsets | ||
CONNECT_STATUS_STORAGE_TOPIC: _connect-status | ||
CONNECT_KEY_CONVERTER: org.apache.kafka.connect.storage.StringConverter | ||
CONNECT_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter | ||
CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter | ||
CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter | ||
CONNECT_LOG4J_ROOT_LOGLEVEL: "INFO" | ||
CONNECT_LOG4J_LOGGERS: "org.apache.kafka.connect.runtime.rest=WARN,org.reflections=ERROR" | ||
CONNECT_LOG4J_APPENDER_STDOUT_LAYOUT_CONVERSIONPATTERN: "[%d] %p %X{connector.context}%m (%c:%L)%n" | ||
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: "1" | ||
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: "1" | ||
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: "1" | ||
# # Optional settings to include to support Confluent Control Center | ||
CONNECT_PRODUCER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor" | ||
CONNECT_CONSUMER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor" | ||
# --------------- | ||
CONNECT_PLUGIN_PATH: /usr/share/java,/usr/share/confluent-hub-components,/data/connect-jars | ||
# If you want to use the Confluent Hub installer to d/l component, but make them available | ||
# when running this offline, spin up the stack once and then run : | ||
# docker cp kafka-connect:/usr/share/confluent-hub-components ./data/connect-jars | ||
volumes: | ||
- kafka-connect-catalogo-de-videos:/data | ||
# In the command section, $ are replaced with $$ to avoid the error 'Invalid interpolation format for "command" option' | ||
command: | ||
- bash | ||
- -c | ||
- | | ||
echo "Installing Connector" | ||
confluent-hub install --no-prompt debezium/debezium-connector-postgresql:latest | ||
# | ||
echo "Launching Kafka Connect worker" | ||
/etc/confluent/docker/run & | ||
# | ||
sleep infinity | ||
networks: | ||
- kafka-catalogo-de-videos | ||
- postgresql-admin-do-catalogo | ||
|
||
networks: | ||
catalogo-de-videos: | ||
external: true | ||
kafka-catalogo-de-videos: | ||
external: true | ||
postgresql-admin-do-catalogo: | ||
external: true | ||
keycloak-codeflix: | ||
external: true | ||
elasticsearch-codeflix: | ||
external: true | ||
|
||
volumes: | ||
kafka-catalogo-de-videos: | ||
external: true | ||
kafka-connect-catalogo-de-videos: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.