services:
  nginx-ui:
    build: .
    image: nginx-ui-dev
    container_name: nginx-ui
    volumes:
      - ~/.ssh:/root/.ssh
      - ../..:/workspaces:cached
      - go-modules:/root/go
      - ./data/nginx:/etc/nginx
      - ./data/nginx-logs:/var/log/nginx
      - /var/run/docker.sock:/var/run/docker.sock
    command: sleep infinity
    environment:
      - NGINX_UI_CERT_CA_DIR=https://pebble:14000/dir
    networks:
      nginxui:
  nginx-ui-2:
    image: nginx-ui-dev
    container_name: nginx-ui-2
    volumes:
      - ../..:/workspaces:cached
      - ./data/nginx-ui-2/nginx:/etc/nginx
      - ./data/nginx-ui-2/nginx-ui:/etc/nginx-ui
    working_dir: /workspaces/nginx-ui
    command: ./.devcontainer/node-supervisor.sh
    depends_on:
      - nginx-ui
    networks:
      nginxui:
  nginx-ui-3:
    image: nginx-ui-dev
    container_name: nginx-ui-3
    environment:
      - NGINX_UI_OFFICIAL_DOCKER=true
    volumes:
      - ../..:/workspaces:cached
      - ./data/nginx-ui-3/nginx:/etc/nginx
      - ./data/nginx-ui-3/nginx-ui:/etc/nginx-ui
      - /var/run/docker.sock:/var/run/docker.sock
    working_dir: /workspaces/nginx-ui
    command: ./.devcontainer/node-supervisor.sh
    depends_on:
      - nginx-ui
    networks:
      nginxui:
  nginx:
    image: nginx-ui-dev
    container_name: nginx
    volumes:
      - ./data/nginx-ui-3/nginx:/etc/nginx
    command: sleep infinity
    networks:
      nginxui:
  pebble:
    image: ghcr.io/letsencrypt/pebble:latest
    volumes:
      - ./pebble-test:/test
    command: -config /test/config/pebble-config.json -strict -dnsserver challtestsrv:8053
    ports:
      - 14000:14000 # HTTPS ACME API
      - 15000:15000 # HTTPS Management API
    environment:
      - PEBBLE_VA_NOSLEEP=1
      - PEBBLE_VA_ALWAYS_VALID=1
      - PEBBLE_WFE_NONCEREJECT=0
    networks:
      nginxui:
  challtestsrv:
    image: ghcr.io/letsencrypt/pebble-challtestsrv:latest
    command: -defaultIPv6 "" -defaultIPv4 challtestsrv
    ports:
      - 8055:8055 # HTTP Management API
    networks:
      nginxui:
  casdoor:
    image: casbin/casdoor-all-in-one
    ports:
      - 8001:8000
    networks:
      - nginxui

networks:
  nginxui:

volumes:
  go-modules:
