Skip to content

Instantly share code, notes, and snippets.

@maiostri
Created May 28, 2022 01:11
Show Gist options
  • Save maiostri/bad185bc63877df30a5a1a368c8dd965 to your computer and use it in GitHub Desktop.
Save maiostri/bad185bc63877df30a5a1a368c8dd965 to your computer and use it in GitHub Desktop.
version: "3.9"
services:
# Base de dados MySQL
alunos-mysql:
image: "mysql:latest"
container_name: "alunos-mysql"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: alunos
networks:
services-network-01:
aliases:
- alunos-mysql
# App de alunos, que usa o mysql
alunos-app:
build: ~/alunos-api/
ports:
# Agora posso usar localhost:8080/aluno/add
- "8080:80"
depends_on:
- alunos-mysql
- eureka-server
container_name: "alunos-mysql-app-instance"
networks:
services-network-01:
aliases:
- alunos-service
presencas-mongo:
image: "mongo:latest"
command: mongod --port 27018
container_name: "presencas-mongo"
hostname: "presencas-mongo"
restart: always
ports:
- "27018:27018"
networks:
services-network-01:
aliases:
- presencas-mongo
# Base de dados mongo
turmas-mongo:
image: "mongo:latest"
container_name: "turmas-mongo"
hostname: "turmas-mongo"
ports:
- "27017:27017"
networks:
services-network-01:
aliases:
- turmas-mongo
# App de turmas, que usa o mongo
turmas-app:
build: ~/turmas-api
ports:
# Consumindo do lado de fora -> localhost:80/turma/add
- "80:80"
container_name: "turmas-app-instance"
depends_on:
- turmas-mongo
- eureka-server
- alunos-app
networks:
services-network-01:
aliases:
- turmas-service
classes-app:
build: ~/classes-api/
container_name: "classes-app-instance"
ports:
- "8082:8082"
depends_on:
- presencas-mongo
- eureka-server
- alunos-app
- turmas-app
networks:
services-network-01:
aliases:
- classes-service
prometheus:
image: "prom/prometheus"
container_name: prometheus-app
ports:
- "9090:9090"
# networks:
# - school-network
volumes:
- ./prometheus/:/etc/prometheus
- ./prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
grafana:
container_name: grafana
image: grafana/grafana:latest
volumes:
- ./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
ports:
- "3000:3000"
depends_on:
- prometheus
eureka-server:
build: ~/eureka-server
ports:
- "8761:8761"
container_name: "eureka-server"
networks:
services-network-01:
aliases:
- eureka-server
networks:
services-network-01:
name: services-network-01
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment