docker编排

3.3版本的编排
version: '3.4'

services:
  proxy:
    image: jwilder/nginx-proxy
    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/acme:/acmecerts
      - ./nginx-proxy/vhost.d:/etc/nginx/vhost.d
      - ./nginx-proxy/html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
    restart: always
  letsencrypt-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: letsencrypt
    restart: always
    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
    depends_on:
      - proxy
    restart: always

 2.0版本的编排

version: "2"
services:
  nginx-proxy:
    image: index.docker.io/jwilder/nginx-proxy:latest
    restart: always
    ports:
    - 443:443
    - 80:80
    volumes:
    - /data/docker/nginx_proxy/certs:/etc/nginx/certs:ro
    - /var/run/docker.sock:/tmp/docker.sock:ro
    - /data/nginx_proxy/vhost.d:/etc/nginx/vhost.d
    - /data/nginx_proxy/html:/usr/share/nginx/html
    labels:
    - com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
  letsencrypt:
    image: index.docker.io/jrcs/letsencrypt-nginx-proxy-companion:latest
    volumes_from:
    - nginx-proxy
    volumes:
    - /data/docker/nginx_proxy/certs:/etc/nginx/certs
    - /var/run/docker.sock:/var/run/docker.sock:ro

 

nginx-proxy:
  image: index.docker.io/jwilder/nginx-proxy:latest
  restart: always
  ports:
  - 443:443
  - 80:80
  volumes:
  - /data/docker/nginx_proxy/certs:/etc/nginx/certs:ro
  - /var/run/docker.sock:/tmp/docker.sock:ro
  - /etc/nginx/vhost.d
  - /usr/share/nginx/html
  labels:
  - com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
letsencrypt:
  image: index.docker.io/jrcs/letsencrypt-nginx-proxy-companion:latest
  volumes_from:
  - nginx-proxy
  volumes:
  - /data/docker/nginx_proxy/certs:/etc/nginx/certs
  - /var/run/docker.sock:/var/run/docker.sock:ro
oj_wxy1_cn:
  image: index.docker.io/shiningrise/hustoj:latest
  restart: always
  privileged: true
  tty: true
  volumes:
  - /data/docker/oj.wxy1.cn:/data
  environment:
  - TZ=Asia/Shanghai
  - VIRTUAL_HOST=wxy.work,oj.wxy1.cn
  - LETSENCRYPT_HOST=wxy.work,oj.wxy1.cn
  - LETSENCRYPT_EMAIL=shiningrise@qq.com

 

soft_wuxiaoyang_cn:
  image: nginx:1.20.0
  privileged: true
  restart: always
  environment:
  - VIRTUAL_HOST=soft.wuxiaoyang.cn
  - LETSENCRYPT_HOST=soft.wuxiaoyang.cn
  - LETSENCRYPT_EMAIL=shiningrise@qq.com
  volumes:
  - /data/soft.wuxiaoyang.cn:/usr/share/nginx/html

 

eschoolweb:
  image: nginx:1.14.0
  privileged: true
  restart: always
  tty: true
  environment:
  - TZ=Asia/Shanghai
  - VIRTUAL_HOST=e.wxy.work
  - LETSENCRYPT_HOST=e.wxy.work
  - LETSENCRYPT_EMAIL=shiningrise@qq.com
  volumes:
  - /data/docker/eschool/web:/usr/share/nginx/html

 数据库备份docker

oy_dbbak:
  image: index.docker.io/shiningrise/mysql-cron-backup
  restart: always
  environment:
  - MYSQL_USER=root
  - MYSQL_PASS=ykbopZheXsHJQfyJif9o2MsXeY3Hrg
  - MYSQL_HOST=oy_db
  - MYSQL_DB=Enrolment
  - CRON_TIME=0 0 * * *
  - INIT_BACKUP=true
  - MAX_BACKUPS=5
  - TZ=Asia/Shanghai
  links:
  - oy_db:oy_db
  volumes:
  - /data/docker/oy_wxy1_cn/db/backup:/backup

 

posted @ 2021-05-10 01:00  shiningrise  阅读(60)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css