Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3.8"
- services:
- traefik:
- container_name: "platon-reverse-proxy"
- image: "traefik:v2.6"
- ports:
- # Listen on port 80, default for HTTP.
- - ${TRAEFIK_PORT:-80}:80
- volumes:
- # Add Docker as a mounted volume, so that Traefik can read the labels of other services.
- - /var/run/docker.sock:/var/run/docker.sock:ro
- # Mount the configuration.
- - ./traefik:/etc/traefik:ro
- networks:
- # Use the public network created to be shared between Traefik and
- # any other service that needs to be publicly available.
- - reverse-proxy-public
- platon:
- build:
- context: 'platon'
- dockerfile: './docker/node/Dockerfile'
- container_name: platon-main
- restart: unless-stopped
- env_file:
- - .env
- volumes:
- - ./tdlib:/usr/src/app/db
- ports:
- - ${PLATON_PORT:-8080}:8080
- labels:
- # Enable Traefik for this service, to make it available in the public network
- - "traefik.enable=true"
- # Uses the environment variable DOMAIN.
- - "traefik.http.routers.api.entrypoints=${WEB_ENTRY_POINT}"
- - "traefik.http.routers.api.rule=Host(`platon.${DOMAIN}`)"
- # Define the port inside of the Docker service to use
- - "traefik.http.services.api.loadbalancer.server.port=8080"
- # Set default middleware for api service.
- - "traefik.http.routers.api.middlewares=default@file"
- networks:
- # Use the "reverse-proxy-public" network created to be shared between Traefik and
- # any other service that needs to be publicly available.
- - reverse-proxy-public
- platon-db-postrges:
- container_name: "platon-db-postrges"
- image: postgres:14.0
- restart: always
- expose:
- - 5432
- ports:
- - 5437:5432
- env_file:
- - .env
- volumes:
- - api-postgres:/var/lib/postgresql/data
- networks:
- - reverse-proxy-public
- redis:
- container_name: platon-redis
- image: redis:6.2.7
- # command: --requirepass "${REDIS_PASSWORD}"
- volumes:
- - redis:/data
- ports:
- - "6382:6379"
- networks:
- - reverse-proxy-public
- mailhog:
- container_name: platon-mailhog
- image: 'mailhog/mailhog:latest'
- ports:
- - '${FORWARD_MAILHOG_PORT:-1025}:1025'
- - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
- networks:
- - reverse-proxy-public
- volumes:
- api-postgres:
- redis:
- tdlib:
- networks:
- # Use the previously created public network "reverse-proxy-public", shared with other
- # services that need to be publicly available via this Traefik
- reverse-proxy-public:
- external: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement