Advertisement
Mochinov

Untitled

Nov 8th, 2022
2,133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.63 KB | None | 0 0
  1. version: "3.8"
  2. services:
  3.   traefik:
  4.     container_name: "platon-reverse-proxy"
  5.     image: "traefik:v2.6"
  6.     ports:
  7.      # Listen on port 80, default for HTTP.
  8.       - ${TRAEFIK_PORT:-80}:80
  9.     volumes:
  10.      # Add Docker as a mounted volume, so that Traefik can read the labels of other services.
  11.       - /var/run/docker.sock:/var/run/docker.sock:ro
  12.       # Mount the configuration.
  13.       - ./traefik:/etc/traefik:ro
  14.     networks:
  15.      # Use the public network created to be shared between Traefik and
  16.       # any other service that needs to be publicly available.
  17.       - reverse-proxy-public
  18.  
  19.   platon:
  20.     build:
  21.       context: 'platon'
  22.       dockerfile: './docker/node/Dockerfile'
  23.     container_name: platon-main
  24.     restart: unless-stopped
  25.     env_file:
  26.      - .env
  27.     volumes:
  28.      - ./tdlib:/usr/src/app/db
  29.     ports:
  30.      - ${PLATON_PORT:-8080}:8080
  31.     labels:
  32.      # Enable Traefik for this service, to make it available in the public network
  33.       - "traefik.enable=true"
  34.       # Uses the environment variable DOMAIN.
  35.       - "traefik.http.routers.api.entrypoints=${WEB_ENTRY_POINT}"
  36.       - "traefik.http.routers.api.rule=Host(`platon.${DOMAIN}`)"
  37.       # Define the port inside of the Docker service to use
  38.       - "traefik.http.services.api.loadbalancer.server.port=8080"
  39.       # Set default middleware for api service.
  40.       - "traefik.http.routers.api.middlewares=default@file"
  41.     networks:
  42.      # Use the "reverse-proxy-public" network created to be shared between Traefik and
  43.       # any other service that needs to be publicly available.
  44.       - reverse-proxy-public
  45.  
  46.   platon-db-postrges:
  47.     container_name: "platon-db-postrges"
  48.     image: postgres:14.0
  49.     restart: always
  50.     expose:
  51.      - 5432
  52.     ports:
  53.      - 5437:5432
  54.     env_file:
  55.      - .env
  56.     volumes:
  57.      - api-postgres:/var/lib/postgresql/data
  58.     networks:
  59.      - reverse-proxy-public
  60.  
  61.   redis:
  62.     container_name: platon-redis
  63.     image: redis:6.2.7
  64. #    command: --requirepass "${REDIS_PASSWORD}"
  65.     volumes:
  66.      - redis:/data
  67.     ports:
  68.      - "6382:6379"
  69.     networks:
  70.      - reverse-proxy-public
  71.  
  72.   mailhog:
  73.     container_name: platon-mailhog
  74.     image: 'mailhog/mailhog:latest'
  75.     ports:
  76.      - '${FORWARD_MAILHOG_PORT:-1025}:1025'
  77.       - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
  78.     networks:
  79.      - reverse-proxy-public
  80.  
  81. volumes:
  82.   api-postgres:
  83.   redis:
  84.   tdlib:
  85. networks:
  86.  # Use the previously created public network "reverse-proxy-public", shared with other
  87.   # services that need to be publicly available via this Traefik
  88.   reverse-proxy-public:
  89.     external: true
  90.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement