Skip to content

Commit

Permalink
update env variables in docker compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
IkeHunter committed Nov 6, 2024
1 parent 2947bf1 commit b6c98d7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 71 deletions.
87 changes: 42 additions & 45 deletions docker-compose.network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ services:
- NODE_ENV=network
- PORT=9000
- HOST=localhost
- JWT_SECRET_KEY=changeme
- TOKEN_HEADER_KEY=Authorization
- MONGO_URI=mongodb://root:changeme@mongo-network-jbx:27017
- LOG_LEVEL=debug
- KAFKA_BROKERS=kafka-jbx:9092
- BASE_URL=http://localhost:8080
Expand Down Expand Up @@ -103,50 +100,50 @@ services:
####################################
# Kafka Config
####################################
zookeeper:
image: confluentinc/cp-zookeeper:latest
container_name: zookeeper-jbx
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- 2181:2181
networks:
- cluster
attach: false
# zookeeper:
# image: confluentinc/cp-zookeeper:latest
# container_name: zookeeper-jbx
# environment:
# ZOOKEEPER_CLIENT_PORT: 2181
# ZOOKEEPER_TICK_TIME: 2000
# ports:
# - 2181:2181
# networks:
# - cluster
# attach: false

kafka:
image: confluentinc/cp-kafka:latest
container_name: kafka-jbx
depends_on:
- zookeeper
ports:
- 9092:9092
- 29092:29092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper-jbx:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-jbx:9092,PLAINTEXT_HOST://localhost:29092
# KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,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
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
networks:
- cluster
attach: false
# kafka:
# image: confluentinc/cp-kafka:latest
# container_name: kafka-jbx
# depends_on:
# - zookeeper
# ports:
# - 9092:9092
# - 29092:29092
# environment:
# KAFKA_BROKER_ID: 1
# KAFKA_ZOOKEEPER_CONNECT: zookeeper-jbx:2181
# KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-jbx:9092,PLAINTEXT_HOST://localhost:29092
# # KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,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
# KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
# networks:
# - cluster
# attach: false

kafka-api:
image: 'docker-spring-boot-postgres:latest'
build:
context: ./kafka-api
container_name: kafka-api-jbx
ports:
- 9090:8080
environment:
- SPRING_PROFILES_ACTIVE=dev
depends_on:
- kafka
# kafka-api:
# image: 'docker-spring-boot-postgres:latest'
# build:
# context: ./kafka-api
# container_name: kafka-api-jbx
# ports:
# - 9090:8080
# environment:
# - SPRING_PROFILES_ACTIVE=dev
# depends_on:
# - kafka

volumes:
client-dist:
Expand Down
10 changes: 1 addition & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@ services:
- NODE_ENV=dev
- PORT=8000
- HOST=localhost
- JWT_SECRET_KEY=changeme
- TOKEN_HEADER_KEY=Authorization
- MONGO_HOST=mongo
- MONGO_PORT=27017
- MONGO_DB=db
- MONGO_USER=root
- MONGO_PASSWORD=changeme
- MONGO_URI=mongodb://root:changeme@mongo-jbx:27017
- LOG_LEVEL=debug
- SPOTIFY_CLIENT_ID=${SPOTIFY_CLIENT_ID}
- SPOTIFY_CLIENT_SECRET=${SPOTIFY_CLIENT_SECRET}
- LOG_LEVEL=debug
- DB_HOST=jbx-dev-db
- DB_PORT=5432
- DB_USER=devuser
Expand Down
19 changes: 2 additions & 17 deletions sample.env
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
# Environment Variables

## Spotify - Required
SP_ID=changeme
SP_SECRET=changeme

## Spotify - Optional
SP_URI=http://localhost:8000/spotify-login-callback

## Node - Optional
PORT=8000
HOST=127.0.0.1

## Mongo - Optional
MONGO_HOST=mongo
MONGO_PORT=27017
MONGO_DB=db
MONGO_USER=root
MONGO_PASSWORD=password
SPOTIFY_CLIENT_ID="example"
SPOTIFY_CLIENT_SECRET="another-example"

0 comments on commit b6c98d7

Please sign in to comment.