From b9a43d09b40ef95acbf37d9c75cd020b99e9ba06 Mon Sep 17 00:00:00 2001 From: "Dimitri B." Date: Fri, 29 Nov 2024 19:48:49 +0100 Subject: [PATCH] Allow changing the APM server port via .env file --- apm-server/config/apm-server.yml | 2 +- docker-compose.yml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apm-server/config/apm-server.yml b/apm-server/config/apm-server.yml index 68a6559..3c6dd36 100644 --- a/apm-server/config/apm-server.yml +++ b/apm-server/config/apm-server.yml @@ -4,7 +4,7 @@ apm-server: # Defines the host and port the server is listening on. Use "unix:/path/to.sock" to listen on a unix domain socket. - host: "0.0.0.0:8200" + host: "0.0.0.0:${APMSERVER_PORT}" #---------------------------- APM Server - Secure Communication with Agents ---------------------------- diff --git a/docker-compose.yml b/docker-compose.yml index 3d895fc..60395a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -134,8 +134,6 @@ services: args: ELK_VERSION: $ELK_VERSION restart: unless-stopped - ports: - - "8200:8200" volumes: - ./apm-server/config/apm-server.yml:/usr/share/apm-server/apm-server.yml:ro environment: @@ -143,6 +141,9 @@ services: ELASTIC_PASSWORD: ${ELASTIC_PASSWORD} ELASTICSEARCH_HOST_PORT: https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT} ELASTIC_APM_SECRET_TOKEN: ${ELASTIC_APM_SECRET_TOKEN} + APMSERVER_PORT: ${APMSERVER_PORT} + ports: + - "${APMSERVER_PORT}:${APMSERVER_PORT}" secrets: - source: elastic.ca target: /certs/ca.crt