version: '3.7'
services:
  app:
    build:
      context: .
      dockerfile: ./docker/app/Dockerfile
    volumes:
      - ./d1/:/app/d1/:ro
      - ./tmp/cache/:/app/tmp/cache/:ro
    restart: always
  ssl-app:
    build:
      context: .
      dockerfile: ./docker/ssl-app/Dockerfile
    volumes:
      - ./d1/:/app/d1/:ro
      - ./tmp/d1/:/app/tmp/d1/:ro
      - ./tmp/d1/letsencrypt:/etc/letsencrypt:rw
    restart: always

  cpanel:
    build:
      context: .
      dockerfile: ./docker/cpanel/Dockerfile
    links:
      - app
    volumes:
      - ./d1/:/app/d1:ro
      - ./tmp/d1/:/app/tmp/d1/:ro
    restart: always
  dynu:
    build:
      context: .
      dockerfile: ./docker/dynu/Dockerfile
    volumes:
      - ./d1/dynu_update.py:/app/d1/dynu_update.py:ro
      - ./tmp/cache/dynu.auth.json:/app/tmp/cache/dynu.auth.json:ro
    restart: always
    links:
      - ngrok
  ngrok:
    image: wernight/ngrok
    links:
      - app
    command: ['ngrok', 'http', 'app:80']
    volumes:
      - ./tmp/cache/ngrok.yml:/home/ngrok/.ngrok2/ngrok.yml:ro
    restart: always
  #forward:
  #  build:
  #    context: .
  #    dockerfile: ./docker/forward/Dockerfile
  #  volumes:
  #    - ./d1/forward.py:/app/d1/forward.py:ro
  #    - ./tmp/cache/forward_data:/app/tmp/cache/forward_data:ro
  #  restart: always