version: "3.8"

services:
  mysql-alias1:
    container_name: "mysql-alias1"
    image: "seffeng/mysql:latest"
    ports:
      - "3306:3306"
    networks:
      network-01:
        aliases:
          - mysql-net1
    volumes:
      - "/srv/websrv/data/mysql:/opt/websrv/data/mysql"
      - "/srv/websrv/tmp:/opt/websrv/tmp"
      - "/srv/websrv/logs/mysql:/opt/websrv/logs"

  php-71-alias1:
    container_name: "php-71-alias1"
    image: "seffeng/php:7.1"
    networks:
      network-01:
        aliases:
          - php-71-net1
    #extra_hosts:
    #  - "localhost:127.0.0.1"
    volumes:
      - "/srv/websrv/data/wwwroot:/opt/websrv/data/wwwroot"
      - "/srv/websrv/tmp:/opt/websrv/tmp"
      - "/srv/websrv/logs/php/7.1:/opt/websrv/logs"

  php-72-alias1:
    container_name: "php-72-alias1"
    image: "seffeng/php:7.2"
    networks:
      network-01:
        aliases:
          - php-72-net1
    #extra_hosts:
    #  - "localhost:127.0.0.1"
    volumes:
      - "/srv/websrv/data/wwwroot:/opt/websrv/data/wwwroot"
      - "/srv/websrv/tmp:/opt/websrv/tmp"
      - "/srv/websrv/logs/php/7.2:/opt/websrv/logs"

  php-73-alias1:
    container_name: "php-73-alias1"
    image: "seffeng/php:7.3"
    networks:
      network-01:
        aliases:
          - php-73-net1
    #extra_hosts:
    #  - "localhost:127.0.0.1"
    volumes:
      - "/srv/websrv/data/wwwroot:/opt/websrv/data/wwwroot"
      - "/srv/websrv/tmp:/opt/websrv/tmp"
      - "/srv/websrv/logs/php/7.3:/opt/websrv/logs"

  php-74-alias1:
    container_name: "php-74-alias1"
    image: "seffeng/php:7.4"
    networks:
      network-01:
        aliases:
          - php-74-net1
    #extra_hosts:
    #  - "localhost:127.0.0.1"
    volumes:
      - "/srv/websrv/data/wwwroot:/opt/websrv/data/wwwroot"
      - "/srv/websrv/tmp:/opt/websrv/tmp"
      - "/srv/websrv/logs/php/7.4:/opt/websrv/logs"

  nginx-alias1:
    container_name: "nginx-alias1"
    image: "seffeng/openresty"
    ports:
      - "80:80"
      - "443:443"
    networks:
      network-01:
        aliases:
          - nginx-net1
    volumes:
      - "/srv/websrv/data/wwwroot:/opt/websrv/data/wwwroot"
      - "/srv/websrv/tmp:/opt/websrv/tmp"
      - "/srv/websrv/logs/nginx:/opt/websrv/logs"
      - "/srv/websrv/config/nginx/conf.d:/opt/websrv/config/nginx/conf.d"
      - "/srv/websrv/config/nginx/certs.d:/opt/websrv/config/nginx/certs.d"

  redis-alias1:
    container_name: "redis-alias1"
    image: "seffeng/redis"
    ports:
      - "6379:6379"
    networks:
      network-01:
        aliases:
          - redis-net1
    volumes:
      - "/srv/websrv/data/redis:/opt/websrv/data/redis"
      - "/srv/websrv/tmp:/opt/websrv/tmp"

networks:
  network-01:
    driver: bridge
    name: network-01


更多配置参考官网