侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 450 篇文章
  • 累计创建 183 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

Docker-Compose挂载本地目录示例

WinJay
2021-12-02 / 0 评论 / 0 点赞 / 183 阅读 / 2671 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。

Docker-Compose挂载本地目录示例

# 执行时自动获取当前绝对路径并进行填充写入配置文件


volumes:
  - ./Proxy-nginx:/etc/nginx

## Demo
 portal:
    image: goharbor/harbor-portal:v2.2.1
    container_name: harbor-portal
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
      - NET_BIND_SERVICE
    volumes:
      - type: bind
        source: ./common/config/portal/nginx.conf
        target: /etc/nginx/nginx.conf


---
services:
  log:
    image: goharbor/harbor-log:v2.2.1
    container_name: harbor-log
    restart: always
    dns_search: .
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - DAC_OVERRIDE
      - SETGID
      - SETUID
    volumes:
      - /mnt/000.Docker/003.Harbor/log//:/var/log/docker/:z
      - type: bind
        source: ./common/config/log/logrotate.conf
        target: /etc/logrotate.d/logrotate.conf
      - type: bind
        source: ./common/config/log/rsyslog_docker.conf
        target: /etc/rsyslog.d/rsyslog_docker.conf

---
  redis:
    image: goharbor/redis-photon:v2.2.1
    container_name: redis
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    volumes:
      - /mnt/000.Docker/003.Harbor/Data/redis:/var/lib/redis



---
  proxy:
    image: goharbor/nginx-photon:v2.2.1
    container_name: nginx
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
      - NET_BIND_SERVICE
    volumes:
      - ./common/config/nginx:/etc/nginx:z
      - /mnt/000.Docker/003.Harbor/Data/secret/cert:/etc/cert:z
      - type: bind
        source: ./common/config/shared/trust-certificates
        target: /harbor_cust_cert



---
  core:
    image: goharbor/harbor-core:v2.2.1
    container_name: harbor-core
    env_file:
      - ./common/config/core/env
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - SETGID
      - SETUID
    volumes:
      - /mnt/000.Docker/003.Harbor/Data/ca_download/:/etc/core/ca/:z
      - /mnt/000.Docker/003.Harbor/Data/:/data/:z
      - ./common/config/core/certificates/:/etc/core/certificates/:z
      - type: bind
        source: ./common/config/core/app.conf
        target: /etc/core/app.conf
      - type: bind
        source: /mnt/000.Docker/003.Harbor/Data/secret/core/private_key.pem
        target: /etc/core/private_key.pem
      - type: bind
        source: /mnt/000.Docker/003.Harbor/Data/secret/keys/secretkey
        target: /etc/core/key
      - type: bind
        source: ./common/config/shared/trust-certificates
        target: /harbor_cust_cert

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区