分类

链接

2024 年 11 月
 123
45678910
11121314151617
18192021222324
252627282930  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > Docker > 正文
共享办公室出租
docker-compose安装phpmyadmin
Docker 暂无评论 阅读(24)

docker-compose.yml

version : '3'
services:    
  mysql:
    container_name: mysql
    image: docker.m.daocloud.io/mysql:5.7
    build:
      context: ./mysql
    ports:
      - "3306:3306"
    volumes:
      - ./mysql/conf/my.cnf:/etc/mysql/my.cnf
      - ./mysql/logs:/logs
      - ./mysql/data:/var/lib/mysql
      - ./mysql/init-sql/:/docker-entrypoint-initdb.d
    command: [
        '--character-set-server=utf8mb4',
        '--collation-server=utf8mb4_general_ci', 
        '--max_allowed_packet=128M', 
        '--innodb-buffer-pool-size=256M',
        '--default-time-zone=+08:00'
    ]
    environment:
      MYSQL_USER: 'xxxx'
      MYSQL_PASSWORD: 'xxxx'
      MYSQL_DATABASE:  'xxxx'
      MYSQL_ROOT_PASSWORD: 'xxxx'
    restart: always
     
  pma:
    image: docker.m.daocloud.io/phpmyadmin/phpmyadmin:latest
    container_name: pma
    restart: always
    ports:
      - 8080:80
    environment:
      PMA_ARBITRARY: 1
      PMA_PORTS: 3306
      PMA_HOST: mysql
      PMA_ABSOLUTE_URI: /pma/

nginx.conf

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }
 
        location /api/ {
        proxy_pass http://localhost:8000/api/;
            proxy_set_header  Host             $host;
            proxy_set_header  X-Real-IP        $remote_addr;
            proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_connect_timeout 60s;
            proxy_send_timeout 60s;
            proxy_read_timeout 60s;
        }
        
        location /pma/ {
        proxy_pass http://localhost:8080/;
            proxy_set_header  Host             $host;
            proxy_set_header  X-Real-IP        $remote_addr;
            proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_connect_timeout 60s;
            proxy_send_timeout 60s;
            proxy_read_timeout 60s;
        }
        
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
 
    }

 

}

 

 

============ 欢迎各位老板打赏~ ===========

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:docker-compose安装phpmyadmin | Bruce's Blog

发表评论

留言无头像?