docker-compose 案例写法


nginx: container_name:
'nginx' image: 'feitian/nginx' ports: - "14725:80" restart: always volumes: - /opt/ty_cms_content/configFile/nginx.conf:/etc/nginx/nginx.conf - /opt/ty_cms_content/upload/:/home mysql: container_name: 'mysql' image: 'feitian/mysql' ports: - "3307:3306" restart: always environment: - MYSQL_ROOT_PASSWORD=1234 volumes: - /opt/ty_cms_content/configFile:/etc/mysql/conf.d - /opt/ty_cms_content/mysql_data:/var/lib/mysql redis: container_name: 'redis' image: 'redis:3.2' ports: - "6379:6379" restart: always command: redis-server --appendonly yes tomacat: container_name: 'tomact' image: 'feitian/tomcat' ports: - "8080:8080" - "8443:8443" restart: always volumes: - /opt/ty_cms_content/webapps/:/usr/local/tomcat/webapps/ - /opt/ty_cms_content/cmsFront/groundcms/:/usr/local/tomcat/cmsFront - /opt/ty_cms_content/upload:/opt/tyUpload ad_tomacat: container_name: 'ad_tomact' image: 'feitian/tomcat' ports: - "8081:8080" - "9443:8443" restart: always volumes: - /opt/ty_cms_content/ad_webapps/:/usr/local/tomcat/webapps/ - /opt/ty_cms_content/ad_cmsFront/groundcms/:/usr/local/tomcat/cmsFront - /opt/ty_cms_content/upload:/opt/tyUpload

使用docker-compose up -d 运行

posted on 2017-06-16 14:56  裤裆内隐藏杀气  阅读(513)  评论(0编辑  收藏  举报

导航