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.
This commit is contained in:
Zachary Laughlin 2023-07-10 01:51:48 -07:00 committed by GitHub
parent 2a31f54e8b
commit 85f1c7754f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ services:
pf-redis: pf-redis:
image: redis:6.2.5-alpine3.14 image: redis:6.2.5-alpine3.14
command: ["redis-server", "--appendonly", "yes"] command: ["redis-server", "--appendonly", "yes"]
hostname: redis container_name: redis
volumes: volumes:
- redis_data:/data - redis_data:/data
networks: networks:
@ -29,14 +29,14 @@ services:
pf-socket: pf-socket:
image: ghcr.io/goryn-clade/pf-websocket:latest image: ghcr.io/goryn-clade/pf-websocket:latest
command: ["--tcpHost", "0.0.0.0"] command: ["--tcpHost", "0.0.0.0"]
hostname: socket container_name: socket
networks: networks:
pf: pf:
aliases: aliases:
- "$PATHFINDER_SOCKET_HOST" - "$PATHFINDER_SOCKET_HOST"
restart: always restart: always
pf: pf:
hostname: pathfinder container_name: pathfinder
image: ghcr.io/goryn-clade/pathfinder:latest image: ghcr.io/goryn-clade/pathfinder:latest
env_file: env_file:
- .env - .env