Skip to content

Commit

Permalink
Merge pull request #345 from aiondemand/configurable-ports
Browse files Browse the repository at this point in the history
Make host ports of docker compose configurable through .env
  • Loading branch information
PGijsbers authored Jul 28, 2024
2 parents b436a80 + 2bf4d2c commit ccc84d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
PYTHONPATH=/app

# REST API
AIOD_REST_PORT=8000

#MYSQL
MYSQL_ROOT_PASSWORD=ok

Expand All @@ -10,16 +13,25 @@ KEYCLOAK_ADMIN_PASSWORD=password
KEYCLOAK_CLIENT_SECRET="QJiOGn09eCEfnqAmcPP2l4vMU8grlmVQ"
REDIRECT_URIS=http://${HOSTNAME}/docs/oauth2-redirect
POST_LOGOUT_REDIRECT_URIS=http://${HOSTNAME}/aiod-auth/realms/aiod/protocol/openid-connect/logout
AIOD_KEYCLOAK_PORT=8080

#ELASTICSEARCH
ES_USER=elastic
ES_PASSWORD=changeme
ES_DISCOVERY_TYPE=single-node
ES_ROLE="edit_aiod_resources"
ES_JAVA_OPTS="-Xmx256m -Xms256m"
AIOD_ES_HTTP_PORT=9200
AIOD_ES_TRANSPORT_PORT=9300

#LOGSTASH
LS_JAVA_OPTS="-Xmx256m -Xms256m"
AIOD_LOGSTASH_BEATS_PORT=5044
AIOD_LOGSTASH_PORT=5000
AIOD_LOGSTASH_API_PORT=9600

#NGINX
AIOD_NGINX_PORT=80

#DATA STORAGE
DATA_PATH=./data
Expand Down
18 changes: 9 additions & 9 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
environment:
- KEYCLOAK_CLIENT_SECRET=$KEYCLOAK_CLIENT_SECRET
ports:
- 8000:8000
- ${AIOD_REST_PORT}:8000
volumes:
- ./src:/app:ro
command: >
Expand Down Expand Up @@ -144,7 +144,7 @@ services:
- REDIRECT_URIS=$REDIRECT_URIS
- POST_LOGOUT_REDIRECT_URIS=$POST_LOGOUT_REDIRECT_URIS
ports:
- 8080:8080
- ${AIOD_KEYCLOAK_PORT}:8080
volumes:
- ${DATA_PATH}/keycloak:/opt/keycloak/data
command: >
Expand All @@ -163,7 +163,7 @@ services:
volumes:
- ./nginx:/etc/nginx/conf.d:ro
ports:
- 80:80
- ${AIOD_NGINX_PORT}:80
depends_on:
app:
condition: service_healthy
Expand All @@ -178,8 +178,8 @@ services:
- ELASTIC_PASSWORD=$ES_PASSWORD
- discovery.type=$ES_DISCOVERY_TYPE
ports:
- 9200:9200
- 9300:9300
- ${AIOD_ES_HTTP_PORT}:9200
- ${AIOD_ES_TRANSPORT_PORT}:9300
volumes:
- type: bind
source: ./es/elasticsearch.yml
Expand Down Expand Up @@ -221,10 +221,10 @@ services:
environment:
- LS_JAVA_OPTS=$LS_JAVA_OPTS
ports:
- 5044:5044
- 5000:5000/tcp
- 5000:5000/udp
- 9600:9600
- ${AIOD_LOGSTASH_BEATS_PORT}:5044
- ${AIOD_LOGSTASH_PORT}:5000/tcp
- ${AIOD_LOGSTASH_PORT}:5000/udp
- ${AIOD_LOGSTASH_API_PORT}:9600
volumes:
- ./logstash/config/config:/usr/share/logstash/config:ro
- ./logstash/config/pipeline:/usr/share/logstash/pipeline:ro
Expand Down

0 comments on commit ccc84d9

Please sign in to comment.