From 85f1c7754fdf9edb882f8c462b72e0a7655a28d2 Mon Sep 17 00:00:00 2001 From: Zachary Laughlin <33877007+ZaxLofful@users.noreply.github.com> Date: Mon, 10 Jul 2023 01:51:48 -0700 Subject: [PATCH] change to container_name Hostname only applies to DNS resolution inside the container itself, it doesn't affect the routing of outside networks or other containers. Setting container_name will set both the name of the container and the Docker Internal DNS routing of all containers to the generic name. Thus achieving both naming convention and DNS resolution. --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8ae6623..72ff847 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: pf-redis: image: redis:6.2.5-alpine3.14 command: ["redis-server", "--appendonly", "yes"] - hostname: redis + container_name: redis volumes: - redis_data:/data networks: @@ -29,14 +29,14 @@ services: pf-socket: image: ghcr.io/goryn-clade/pf-websocket:latest command: ["--tcpHost", "0.0.0.0"] - hostname: socket + container_name: socket networks: pf: aliases: - "$PATHFINDER_SOCKET_HOST" restart: always pf: - hostname: pathfinder + container_name: pathfinder image: ghcr.io/goryn-clade/pathfinder:latest env_file: - .env