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.
103 lines
3.1 KiB
YAML
103 lines
3.1 KiB
YAML
version: "3.9"
|
|
|
|
services:
|
|
pfdb:
|
|
image: bianjp/mariadb-alpine:latest
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: $MYSQL_PASSWORD
|
|
networks:
|
|
pf:
|
|
aliases:
|
|
- "$MYSQL_HOST"
|
|
volumes:
|
|
- db_data:/var/lib/mysql
|
|
- ./pathfinder/export/sql/eve_universe.sql.zip:/eve_universe.sql.zip
|
|
restart: always
|
|
pf-redis:
|
|
image: redis:6.2.5-alpine3.14
|
|
command: ["redis-server", "--appendonly", "yes"]
|
|
container_name: redis
|
|
volumes:
|
|
- redis_data:/data
|
|
networks:
|
|
pf:
|
|
aliases:
|
|
- "$REDIS_HOST"
|
|
logging:
|
|
driver: none
|
|
restart: always
|
|
pf-socket:
|
|
image: ghcr.io/goryn-clade/pf-websocket:latest
|
|
command: ["--tcpHost", "0.0.0.0"]
|
|
container_name: socket
|
|
networks:
|
|
pf:
|
|
aliases:
|
|
- "$PATHFINDER_SOCKET_HOST"
|
|
restart: always
|
|
pf:
|
|
container_name: pathfinder
|
|
image: ghcr.io/goryn-clade/pathfinder:latest
|
|
env_file:
|
|
- .env
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.docker.network=web"
|
|
- "traefik.http.services.pf.loadbalancer.server.port=80"
|
|
- "traefik.http.routers.pf.rule=Host(`${DOMAIN}`)"
|
|
- "traefik.http.routers.pf.entrypoints=web"
|
|
- "traefik.http.routers.pf-secure.rule=Host(`${DOMAIN}`)"
|
|
- "traefik.http.routers.pf-secure.entrypoints=websecure"
|
|
- "traefik.http.routers.pf-secure.tls=true"
|
|
- "traefik.http.routers.pf-secure.tls.certresolver=letsencrypt"
|
|
- "traefik.http.middlewares.redirecthttps.redirectscheme.scheme=https"
|
|
- "traefik.http.routers.pf.middlewares=redirecthttps"
|
|
networks:
|
|
- pf
|
|
- web
|
|
healthcheck:
|
|
disable: true
|
|
volumes:
|
|
- ./config/pathfinder/config.ini:/var/www/html/pathfinder/app/templateConfig.ini
|
|
- ./config/pathfinder/pathfinder.ini:/var/www/html/pathfinder/app/pathfinder.ini
|
|
- ./config/pathfinder/plugin.ini:/var/www/html/pathfinder/app/plugin.ini
|
|
- ./logs:/var/www/html/pathfinder/history/map
|
|
depends_on:
|
|
- pfdb
|
|
- pf-redis
|
|
- pf-socket
|
|
restart: always
|
|
traefik:
|
|
image: traefik:v2.3
|
|
container_name: traefik
|
|
command:
|
|
- "--log.level=ERROR"
|
|
- "--api.insecure=true"
|
|
- "--providers.docker=true"
|
|
- "--providers.docker.exposedbydefault=false"
|
|
- "--entrypoints.web.address=:80"
|
|
- "--entrypoints.websecure.address=:443"
|
|
- "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
|
|
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
|
|
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
|
|
# Remove below line when ready for production
|
|
- "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
|
|
- "--certificatesresolvers.letsencrypt.acme.email=${LE_EMAIL}"
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
- "8080:8080"
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
- "./letsencrypt:/letsencrypt"
|
|
networks:
|
|
- web
|
|
restart: always
|
|
|
|
volumes:
|
|
db_data:
|
|
redis_data:
|
|
networks:
|
|
pf:
|
|
web:
|
|
external: true
|