直接代碼:
version: "2.3"
services:
nginx1.13:
image: nginx:1.13
container_name: nginx1.13
ports:
- "80:80"
# links:
# - "php"
volumes:
- /home/lnmp/www/:/www
- /home/lnmp/app/nginx1.13/conf/:/etc/nginx/conf.d
restart: always
php7.1:
build: ./app/php7.1
container_name: php7.1
ports:
- "9000:9000"
# links:
# - "mysql"
# - "redis"
# - "memcached"
volumes:
- /home/lnmp/www/:/www
working_dir: /www
restart: always
mysql5.7:
image: mysql:5.7
container_name: mysql5.7
ports:
- "3306:3306"
volumes:
- /home/lnmp/data/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: xyz*#ss134
restart: always
redis3.2:
image: redis:3.2
container_name: redis3.2
ports:
- "6379:6379"
volumes:
- /home/lnmp/data/redis:/data
restart: always
memcached1.5:
image: memcached:1.5
container_name: memcached1.5
ports:
- "11211:11211"
restart: always