docker-compose安装phpmyadmin
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;
}
}
}
============ 欢迎各位老板打赏~ ===========
与本文相关的文章
- · Amazon Linux 2023 安装Docker和Docker Compose
- · linux使用docker-compose安装和破解confluence 8.0.2
- · docker-compose通过容器名连接mysql
- · mac os m1可用的NACOS
- · 安装docker-compose(国内高速镜像)
- · 解决phpmyadmin没有权限访问配置文件错误
- · docker insepct logtail
- · 解决confluence文件预览问题,中文乱码问题
- · 原创!无插件hack方式实现conflulence open connect sso登陆
- · 利用k8s ingress访问非POD服务
- · 解决vault sidecar认证失败的问题
- · Docker 快速部署 FastAPI 项目
