Skip to content

Commit

Permalink
Merge pull request #48 from Lukinhasssss/feature/gradle-kotlin-update
Browse files Browse the repository at this point in the history
feat: update docker compose
  • Loading branch information
Lukinhasssss authored Feb 7, 2024
2 parents c8698ae + be45623 commit ee995fc
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ POSTGRES_USER=lukinhasssss
POSTGRES_PASSWORD=348t7y30549g4qptbq4rtbq4b5rq3rvq34rfq3784yq23847yqor78hvgoreiuvn
POSTGRES_DB=adm_videos

DB_POSTGRES_URL=postgres-admin-do-catalogo:5432
DB_POSTGRES_URL=postgres_admin_do_catalogo:5432
DB_POSTGRES_USERNAME=lukinhasssss
DB_POSTGRES_PASSWORD=348t7y30549g4qptbq4rtbq4b5rq3rvq34rfq3784yq23847yqor78hvgoreiuvn
DB_POSTGRES_SCHEMA=adm_videos

FLYWAY_DB=jdbc:postgresql://postgres-admin-do-catalogo:5432/adm_videos
FLYWAY_DB=jdbc:postgresql://postgres_admin_do_catalogo:5432/adm_videos
FLYWAY_USER=lukinhasssss
FLYWAY_PASSWORD=348t7y30549g4qptbq4rtbq4b5rq3rvq34rfq3784yq23847yqor78hvgoreiuvn

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml.old
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- adm_videos_network
restart: on-failure
depends_on:
postgres-admin-do-catalogo:
postgres_admin_do_catalogo:
condition: service_healthy
rabbitmq-admin-do-catalogo:
condition: service_healthy
Expand All @@ -34,7 +34,7 @@ services:
# networks:
# - adm_videos_network

postgres-admin-do-catalogo:
postgres_admin_do_catalogo:
container_name: adm_videos_postgres
image: postgres:latest
restart: unless-stopped
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--alter table categories replica IDENTITY FULL;
--
--alter table genres replica IDENTITY FULL;
--alter table genres_categories replica IDENTITY FULL;
--
--alter table cast_members replica IDENTITY FULL;
--
--alter table videos_video_media replica IDENTITY FULL;
--alter table videos_image_media replica IDENTITY FULL;
--alter table videos replica IDENTITY FULL;
--alter table videos_categories replica IDENTITY FULL;
--alter table videos_genres replica IDENTITY FULL;
--alter table videos_cast_members replica IDENTITY FULL;
10 changes: 8 additions & 2 deletions sandbox/app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: '3.9'

name: app-admin-do-catalogo

services:
admin-do-catalogo:
container_name: admin-do-catalogo
Expand Down Expand Up @@ -27,7 +29,7 @@ services:
- /var/lib/docker/containers:/var/lib/docker/containers:ro # Docker logs
- /var/run/docker.sock:/var/run/docker.sock:ro # Additional information about containers
- ./filebeat/filebeat.yaml:/usr/share/filebeat/filebeat.yml:ro # Configuration file
- ../.docker/filebeat:/usr/share/filebeat/data:rw # Persistence data
- filebeat-admin-do-catalogo:/usr/share/filebeat/data:rw # Persistence data
user: root # Allow access to log files and docker.sock
environment:
- ELASTIC_HOSTS=http://elasticsearch-codeflix:9200
Expand All @@ -40,6 +42,10 @@ services:
- admin-do-catalogo
- elasticsearch-codeflix

volumes:
filebeat-admin-do-catalogo:
external: true

networks:
admin-do-catalogo:
external: true
Expand All @@ -48,4 +54,4 @@ networks:
open-telemetry-codeflix:
external: true
elasticsearch-codeflix:
external: true
external: true
2 changes: 1 addition & 1 deletion sandbox/elk/beats/metricbeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metricbeat.modules:
- module: postgresql
metricsets: [ "database", "bgwriter", "activity" ]
period: 10s
hosts: [ "postgres:////localhost:5432", "postgres://postgres-admin-do-catalogo:5432", "postgres://postgres-admin-do-catalogo:5432/adm_videos", "postgres-admin-do-catalogo:5432" ]
hosts: [ "postgres:////localhost:5432", "postgres://postgres_admin_do_catalogo:5432", "postgres://postgres_admin_do_catalogo:5432/adm_videos", "postgres_admin_do_catalogo:5432" ]

output.elasticsearch:
hosts: ["elasticsearch-codeflix:9200"]
Expand Down
9 changes: 7 additions & 2 deletions sandbox/elk/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
version: '3.9'

name: elasticstack-admin-do-catalogo

services:
elasticsearch-codeflix:
container_name: elasticsearch-admin-do-catalogo
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.0
# image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
ports:
- "9200:9200"
environment:
Expand All @@ -22,7 +23,7 @@ services:
soft: -1
hard: -1
volumes:
- ../.docker/elasticsearch-admin-do-catalogo:/usr/share/elasticsearch/data
- elasticsearch-admin-do-catalogo:/usr/share/elasticsearch/data
healthcheck:
test: [ "CMD-SHELL", "curl --silent --fail http://localhost:9200/_cat/health?h=status" ]
interval: 5s
Expand Down Expand Up @@ -134,6 +135,10 @@ services:
networks:
- elasticsearch-codeflix

volumes:
elasticsearch-admin-do-catalogo:
external: true

networks:
elasticsearch-codeflix:
external: true
Expand Down
2 changes: 1 addition & 1 deletion sandbox/elk/elasticstack_bkp/beats/metricbeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metricbeat.modules:
- module: postgresql
metricsets: [ "database", "bgwriter", "activity" ]
period: 10s
hosts: [ "postgres:////localhost:5432", "postgres://postgres-admin-do-catalogo:5432", "postgres://postgres-admin-do-catalogo:5432/adm_videos", "postgres-admin-do-catalogo:5432" ]
hosts: [ "postgres:////localhost:5432", "postgres://postgres_admin_do_catalogo:5432", "postgres://postgres_admin_do_catalogo:5432/adm_videos", "postgres_admin_do_catalogo:5432" ]

output.elasticsearch:
hosts: ["elasticsearch-admin-do-catalogo:9200"]
Expand Down
4 changes: 4 additions & 0 deletions sandbox/monitoramento/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: '3.9'

name: monitoramento-codeflix

services:
prometheus-codeflix:
container_name: prometheus-codeflix
Expand Down Expand Up @@ -57,4 +59,6 @@ networks:

volumes:
prometheus-data-codeflix:
external: true
grafana-data-codeflix:
external: true
16 changes: 8 additions & 8 deletions sandbox/run.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
printf "Criando as pastas com permissões...\n"
sudo chown root app/filebeat/filebeat.yaml
mkdir -m 777 .docker
mkdir -m 777 .docker/postgresql
mkdir -m 777 .docker/rabbitmq
mkdir -m 777 .docker/keycloak
mkdir -m 777 .docker/filebeat
mkdir -m 777 .docker/elasticsearch-admin-do-catalogo
printf "Criando os docker volumes...\n"
docker volume create postgresql-admin-do-catalogo
docker volume create rabbitmq-admin-do-catalogo
docker volume create keycloak-admin-do-catalogo
docker volume create grafana-data-codeflix
docker volume create prometheus-data-codeflix
docker volume create elasticsearch-admin-do-catalogo
docker volume create filebeat-admin-do-catalogo

# ----------------------------------------------------

Expand Down
26 changes: 18 additions & 8 deletions sandbox/services/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
version: '3.9'

name: services-admin-do-catalogo

services:
postgres-admin-do-catalogo:
container_name: postgres-admin-do-catalogo
postgres_admin_do_catalogo:
container_name: postgres_admin_do_catalogo
image: postgres:latest
restart: unless-stopped
ports:
Expand All @@ -11,10 +13,11 @@ services:
POSTGRES_USER: ${POSTGRES_USER-username}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD-password}
POSTGRES_DB: ${POSTGRES_DB-adm_videos}
command: postgres -c wal_level=logical # Serve para o kafka connect se conectar corretamente com o banco
security_opt:
- seccomp:unconfined
volumes:
- ../.docker/postgresql:/var/lib/postgresql/data
- postgresql-admin-do-catalogo:/var/lib/postgresql/data
healthcheck:
test: [ "CMD", "pg_isready -U lukinhasssss -d adm_videos" ]
timeout: 45s
Expand All @@ -35,7 +38,7 @@ services:
- RABBITMQ_DEFAULT_PASS=123456
- RABBITMQ_DEFAULT_VHOST=/
volumes:
- ../.docker/rabbitmq:/var/lib/rabbitmq:rw
- rabbitmq-admin-do-catalogo:/var/lib/rabbitmq:rw
healthcheck:
test: [ "CMD-SHELL", "rabbitmq-diagnostics -q ping" ]
interval: 5s
Expand All @@ -55,14 +58,21 @@ services:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
volumes:
# - keycloak_data:/opt/keycloak/data/
- ../.docker/keycloak:/opt/keycloak/data/h2:rw
- keycloak-admin-do-catalogo:/opt/keycloak/data/
command:
# - start-dev # Deve ser utilizado quando a aplicação estiver rodando fora de um container
- start-dev --hostname-url=http://keycloak-admin-do-catalogo:8080 # Deve ser utilizado quando a aplicação estiver rodando dentro de um container
- start-dev # Deve ser utilizado quando a aplicação estiver rodando fora de um container
# - start-dev --hostname-url=http://keycloak-admin-do-catalogo:8080 # Deve ser utilizado quando a aplicação estiver rodando dentro de um container
networks:
- admin-do-catalogo-services

volumes:
postgresql-admin-do-catalogo:
external: true
rabbitmq-admin-do-catalogo:
external: true
keycloak-admin-do-catalogo:
external: true

networks:
admin-do-catalogo-services:
external: true

0 comments on commit ee995fc

Please sign in to comment.