services:
  proxy:
    image: nginxproxy/nginx-proxy:1.10
    container_name: nginx-proxy
    restart: always
    ports:
      - 80:80
      - 443:443
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    volumes:
      - ./nginx-proxy/certs:/etc/nginx/certs:ro
      - ./nginx-proxy/config/nginx/conf.d:/etc/nginx/conf.d
      - ./nginx-proxy/vhost.d:/etc/nginx/vhost.d
      - ./nginx-proxy/html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
      
  letsencrypt-companion:
    image: nginxproxy/acme-companion:2.6.3
    container_name: letsencrypt
    environment:
      DEFAULT_EMAIL: shiningrise@qq.com
      ACME_CHALLENGE: DNS-01
      ACMESH_DNS_API_CONFIG: |-
        DNS_API: dns_ali
        Ali_Key: 阿里Key
        Ali_Secret: 阿里密钥
    volumes:
      - ./nginx-proxy/certs:/etc/nginx/certs
      - ./nginx-proxy/vhost.d:/etc/nginx/vhost.d
      - ./nginx-proxy/html:/usr/share/nginx/html
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./nginx-proxy/acme.sh:/etc/acme.sh
    depends_on:
      - proxy
    restart: always
       
  registry:
    image: registry.cn-hangzhou.aliyuncs.com/shiningrise/registry:2
    container_name: registry
    privileged: true
    restart: always
    tty: true
    environment:
    - VIRTUAL_HOST=reg.wuxiaoyang.top
    - VIRTUAL_PORT=5000
    - LETSENCRYPT_HOST=reg.wuxiaoyang.top
    - LETSENCRYPT_EMAIL=shiningrise@qq.com
    - REGISTRY_AUTH=htpasswd
    - REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm
    - REGISTRY_AUTH_HTPASSWD_PATH=/var/lib/registry/htpasswd
    volumes:
    - /etc/localtime:/etc/localtime
    - /etc/default/locale:/etc/default/locale
    - /data/registry:/var/lib/registry

  gitea:
    image:  docker.gitea.com/gitea:1.26.0 #registry.cn-hangzhou.aliyuncs.com/shiningrise/gitea:1.23
    container_name: gitea
    privileged: true
    environment:
      - VIRTUAL_HOST=git.wuxiaoyang.top
      - VIRTUAL_PORT=3000
      - LETSENCRYPT_HOST=git.wuxiaoyang.top
      - LETSENCRYPT_EMAIL=shiningrise@qq.com      
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    volumes:
      - ./gitea:/data  # /home/data可以替换成你想要的挂载目录
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro

发表评论