Docker部署网站环境 nmp+php+mysql

Docker-compose部署 nmp+wordpress+mysql+phpmyadmin,docker-compose.yml文件

version: '3'
services:
  n-p-m:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    network_mode: "host"
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - /docker/docker-compose/mnt/nginx-proxy-mngaer:/data
      - /docker/docker-compose/mnt/nginx-proxy-mngaer/letsencrypt:/etc/letsencrypt
  db:
    image: mysql:5.7
#    network_mode: "web"
    volumes:
      - /docker/docker-compose/mnt/mysql:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 123123

  wordpress:
#    network_mode: "web"
    image: wordpress:php8.2-fpm-alpine
    volumes:
      - /docker/docker-compose/mnt/wordpress:/var/www/html
      - /docker/docker-compose/mnt/wordpress/php-ini:/usr/local/etc/php
    ports:
      - '9080:80'
      - '9090:9000'
    restart: always
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_PASSWORD: 123123

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
#    network_mode: "web"
    ports:
      - 9081:80
    environment:
      PMA_HOST: db
      MYSQL_USER: root
      MYSQL_PASSWORD: 123123

 

如何优雅地替换掉宝塔面板 - DOV

第十七节 Docker部署PHP网站环境 - 参码踪 (shenmazong.com)

php - docker-compose volumes 容器内权限会变为root所有? - SegmentFault 思否

待测试

版权声明:
作者:Jays
链接:https://ijays.com/2023/10/docker-nmp-php-mysql.html
来源:颓废的美
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>