version: '3.4' services: aspnetapp.mysql: image: mysql:5.7 container_name: aspnetapp.mysql ports: - "3306:3306" restart: always environment: - MYSQL_ROOT_PASSWORD=123456 - TZ=Asia/Shanghai volumes: - /app/data/mysql:/var/lib/mysql networks: - aspnetapp-net aspnetapp.web: image: docker.cnb.cool/devopschina/cloud-native-run-dotnet:latest container_name: aspnetapp.web ports: - "8080:80" restart: always depends_on: - aspnetapp.mysql environment: - MYSQL_ADDRESS=aspnetapp.mysql:3306 - MYSQL_USERNAME=root - MYSQL_PASSWORD=123456 - TZ=Asia/Shanghai networks: - aspnetapp-net networks: aspnetapp-net: driver: bridge