Last active
March 16, 2022 20:43
-
-
Save ricardopadua/86c9f211699f45f9db4f1ecffda90142 to your computer and use it in GitHub Desktop.
my docker development environment
This file contains hidden or 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
version: '3.8' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:latest | |
container_name: zookeeper | |
networks: | |
- prologic-net | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
kafka: | |
image: confluentinc/cp-kafka:latest | |
container_name: kafka | |
networks: | |
- prologic-net | |
depends_on: | |
- zookeeper | |
ports: | |
- 9092:9092 | |
environment: | |
KAFKA_BROKER_ID: 1 | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | |
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
kafdrop: | |
image: obsidiandynamics/kafdrop:latest | |
container_name: kafdrop | |
networks: | |
- prologic-net | |
depends_on: | |
- kafka | |
ports: | |
- 19000:9000 | |
environment: | |
KAFKA_BROKERCONNECT: kafka:29092 | |
redis: | |
image: 'redis:6-alpine' | |
container_name: redis | |
restart: always | |
environment: | |
REDIS_HOST: ${REDIS_HOST} | |
REDIS_PASSWORD: ${REDIS_PASSWORD} | |
#command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD} | |
ports: | |
- "6379:6379" | |
networks: | |
- prologic-net | |
hostname: redis | |
profiles: ["dev"] | |
healthcheck: | |
test: ["CMD", "redis-cli", "ping"] | |
interval: 1s | |
timeout: 3s | |
retries: 30 | |
volumes: | |
- './docker-volumes/redis/data:/data' | |
redis-commander: | |
image: rediscommander/redis-commander:latest | |
container_name: rediscommander | |
restart: always | |
environment: | |
REDIS_HOSTS: local:redis:6379 | |
ports: | |
- "8081:8081" | |
networks: | |
- prologic-net | |
hostname: redis-commander | |
profiles: ["dev"] | |
depends_on: | |
redis: | |
condition: service_healthy | |
db: | |
image: 'postgres:13.0-alpine' | |
container_name: postgresdb | |
restart: always | |
environment: | |
POSTGRES_HOST: ${POSTGRES_HOST} | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
POSTGRES_DB: ${POSTGRES_DB} | |
POSTGRES_USER: ${POSTGRES_USER} | |
POSTGRES_HOST_AUTH_METHOD: ${POSTGRES_HOST_AUTH_METHOD} | |
PGDATA: /tmp | |
ports: | |
- '5432:5432' | |
networks: | |
- "prologic-net" | |
hostname: db | |
profiles: ["debug", "dev"] | |
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -U postgres"] | |
interval: 10s | |
timeout: 5s | |
retries: 5 | |
volumes: | |
- './docker-volumes/postgres/data:/var/lib/postgresql/data' | |
pgadmin: | |
container_name: pgadmin | |
image: dpage/pgadmin4 | |
restart: always | |
environment: | |
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL} | |
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD} | |
ports: | |
- "5050:80" | |
networks: | |
- "prologic-net" | |
hostname: pgadmin | |
profiles: ["debug"] | |
depends_on: | |
db: | |
condition: service_healthy | |
networks: | |
prologic-net: | |
name: prologic-net | |
driver: bridge | |
# add etc/hosts | |
# 127.0.0.1 redis | |
# 127.0.0.1 zookeeper | |
# 127.0.0.1 kafka | |
# 127.0.0.1 kafdrop | |
# 127.0.0.1 db | |
# 127.0.0.1 pgadmin |
This file contains hidden or 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
version: '3.8' | |
services: | |
redis: | |
image: 'redis:6-alpine' | |
container_name: prologic-redis | |
restart: always | |
environment: | |
REDIS_HOST: ${REDIS_HOST} | |
REDIS_PASSWORD: ${REDIS_PASSWORD} | |
#command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD} | |
ports: | |
- "6379:6379" | |
networks: | |
- prologic-net | |
hostname: redis | |
profiles: ["debug", "dev"] | |
healthcheck: | |
test: ["CMD", "redis-cli", "ping"] | |
interval: 1s | |
timeout: 3s | |
retries: 30 | |
volumes: | |
- './docker-volumes/redis/data:/data' | |
redis-commander: | |
image: rediscommander/redis-commander:latest | |
container_name: prologic-redis-commander | |
restart: always | |
environment: | |
REDIS_HOSTS: local:redis:6379 | |
ports: | |
- "8081:8081" | |
networks: | |
- prologic-net | |
hostname: redis-commander | |
profiles: ["debug"] | |
depends_on: | |
redis: | |
condition: service_healthy | |
zookeeper: | |
image: zookeeper:3.6 | |
container_name: prologic-zookeeper | |
restart: always | |
environment: | |
ZOO_MY_ID: 1 | |
ZOO_PORT: 2181 | |
ZOO_SERVERS: server.1=zookeeper:2888:3888;2181 | |
ports: | |
- "2181:2181" | |
networks: | |
- prologic-net | |
hostname: zookeeper | |
profiles: ["debug", "dev"] | |
healthcheck: | |
test: ["CMD", "sh", "-c", "nc -nz 127.0.0.1 2181"] | |
interval: 30s | |
timeout: 10s | |
retries: 4 | |
volumes: | |
- './docker-volumes/zookeeper/data:/data' | |
- './docker-volumes/zookeeper/datalog:/datalog' | |
kafka: | |
image: confluentinc/cp-kafka:5.3.0 | |
container_name: prologic-kafka | |
restart: "no" | |
environment: | |
KAFKA_ADVERTISED_LISTENERS: "LISTENER_DOCKER_INTERNAL://kafka:29092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092" | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT | |
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL | |
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" | |
KAFKA_BROKER_ID: 1 | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
ports: | |
- "9092:9092" | |
networks: | |
- "prologic-net" | |
hostname: "kafka" | |
profiles: ["dev"] | |
healthcheck: | |
test: ["CMD", "bash", "-c", "unset" , "JMX_PORT" ,";" ,"/opt/bitnami/kafka/bin/kafka-topics.sh","--zookeeper","zookeeper:2181","--list"] | |
interval: 30s | |
timeout: 10s | |
retries: 4 | |
depends_on: | |
- "zookeeper" | |
volumes: | |
- './docker-volumes/kafka/data:/var/lib/kafka/data' | |
kafdrop: | |
image: 'obsidiandynamics/kafdrop:3.29.0' | |
container_name: prologic-kafdrop | |
restart: always | |
environment: | |
KAFKA_BROKERCONNECT: "kafka:29092" | |
JVM_OPTS: "-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify" | |
ports: | |
- "9000:9000" | |
networks: | |
- "prologic-net" | |
hostname: "kafdrop" | |
profiles: ["debug", "dev"] | |
depends_on: | |
kafka: | |
condition: service_healthy | |
db: | |
image: 'postgres:13.0-alpine' | |
container_name: prologic-db | |
restart: always | |
environment: | |
POSTGRES_HOST: ${POSTGRES_HOST} | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
POSTGRES_DB: ${POSTGRES_DB} | |
POSTGRES_USER: ${POSTGRES_USER} | |
POSTGRES_HOST_AUTH_METHOD: ${POSTGRES_HOST_AUTH_METHOD} | |
PGDATA: /tmp | |
ports: | |
- '5432:5432' | |
networks: | |
- "prologic-net" | |
hostname: db | |
profiles: ["debug", "dev"] | |
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -U postgres"] | |
interval: 10s | |
timeout: 5s | |
retries: 5 | |
volumes: | |
- './docker-volumes/postgres/data:/var/lib/postgresql/data' | |
pgadmin: | |
container_name: prologic-pgadmin | |
image: dpage/pgadmin4 | |
restart: always | |
environment: | |
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL} | |
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD} | |
ports: | |
- "5050:80" | |
networks: | |
- "prologic-net" | |
hostname: pgadmin | |
profiles: ["debug"] | |
depends_on: | |
db: | |
condition: service_healthy | |
networks: | |
prologic-net: | |
name: prologic-net | |
driver: bridge | |
# add etc/hosts | |
# 127.0.0.1 redis | |
# 127.0.0.1 zookeeper | |
# 127.0.0.1 kafka | |
# 127.0.0.1 kafdrop | |
# 127.0.0.1 db | |
# 127.0.0.1 pgadmin |
This file contains hidden or 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
REDIS_HOST= | |
REDIS_PORT= | |
REDIS_PASSWORD= | |
POSTGRES_HOST= | |
POSTGRES_PASSWORD= | |
POSTGRES_DB= | |
POSTGRES_USER= | |
POSTGRES_HOST_AUTH_METHOD= | |
PGADMIN_DEFAULT_EMAIL= | |
PGADMIN_DEFAULT_PASSWORD= |
This file contains hidden or 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
REDIS_HOST=redis | |
REDIS_PORT=6379 | |
REDIS_PASSWORD=eYVX7 | |
POSTGRES_HOST=db | |
POSTGRES_PASSWORD=postgres | |
POSTGRES_DB=prologic | |
POSTGRES_USER=postgres | |
POSTGRES_HOST_AUTH_METHOD=trust | |
[email protected] | |
PGADMIN_DEFAULT_PASSWORD=root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment