docker容器:lnmp环境 介绍基于docker容器的lnmp开发环境 开源仓库:https://github.com/d2gin/docker-lnmp-dev 配置version: "3" services: php: container_name: dev-php build: ./php-fpm/ restart: always links: - mysql - redis expose: - 9000 ports: - 19000:9000 volumes: - $WWW_DIR:/var/www/ # - $PHP_FPM_DIR/conf:/usr/local/etc/ networks: - app_net nginx: container_name: dev-nginx # image: nginx:1.23.3 build: ./nginx/ restart: always links: - php:php-fpm expose: - 80 ports: - 6380:80 depends_on: - php volumes: - $NGINX_DIR/conf.d:/etc/nginx/conf.d - $NGINX_DIR/nginx.conf:/etc/nginx/nginx.conf - $NGINX_DIR/fastcgi.conf:/etc/nginx/fastcgi.conf - $NGINX_DIR/pathinfo.conf:/etc/nginx/pathinfo.conf - $NGINX_DIR/log:/etc/nginx/log - $NGINX_DIR/html:/usr/share/nginx/html - $WWW_DIR:/var/www # 同一个宿主机目录 映射到 不同容器的相同路径的目录 networks: - app_net mysql: container_name: dev-mysql image: mysql:5.7 restart: always environment: TZ: Asia/Shanghai MYSQL_ROOT_PASSWORD: 'root' privileged: true command: --default-authentication-plugin=mysql_native_password volumes: - $MYSQL_DIR/conf.d:/etc/mysql/conf.d - $MYSQL_DIR/data:/var/lib/mysql - $MYSQL_DIR/log:/var/log/mysql expose: - 3306 ports: - 13306:3306 networks: - app_net redis: container_name: dev-redis image: redis restart: always command: redis-server /usr/local/etc/redis/redis.conf volumes: - $REDIS_CONF_FILE:/usr/local/etc/redis/redis.conf expose: - 6379 ports: - 16379:6379 networks: app_net: docker容器:lnmp环境 http://blog.icy8.cn/posts/50426/ 作者 icy8 发布于 2023年2月27日 许可协议 骰子游戏之大话骰 上一篇 使用golang协程并行下载m3u8视频 下一篇