feat: add adminer docker deployment files

add env.cfg configuration, stack.yml compose file and readme documentation for adminer deployment
This commit is contained in:
2026-05-17 01:05:22 +08:00
parent c75c9884c8
commit cdf48c4539
3 changed files with 60 additions and 0 deletions

3
adminer/env.cfg Normal file
View File

@@ -0,0 +1,3 @@
IMAGE_TAG_VER=5.4.2
IMAGE_TAG=adminer:${IMAGE_TAG_VER}
Volumes_Path=/data/volumes/adminer

42
adminer/readme.md Normal file
View File

@@ -0,0 +1,42 @@
# Adminer 部署说明
[Adminer](https://www.adminer.org/) 是一个轻量级的数据库管理工具,支持 MySQL、PostgreSQL、SQLite、MS SQL、Oracle 等多种数据库,单文件 PHP 应用,适合日常数据库运维操作。
## 目录结构
| 文件 | 说明 |
|------|------|
| `stack.yml` | Docker Compose 部署配置 |
| `env.cfg` | 环境变量(镜像版本) |
## 部署命令
```bash
# 拉取镜像
docker compose -p adminer --env-file ./adminer/env.cfg -f ./adminer/stack.yml pull
# 启动服务
docker compose -p adminer --env-file ./adminer/env.cfg -f ./adminer/stack.yml up -d
# 停止服务
docker compose -p adminer --env-file ./adminer/env.cfg -f ./adminer/stack.yml down
```
## 环境变量说明
| 变量 | 说明 | 示例 |
|------|------|------|
| `IMAGE_TAG_VER` | Adminer 镜像版本 | `5.4.2` |
| `IMAGE_TAG` | 完整镜像标签 | `adminer:5.4.2` |
| `Volumes_Path` | 数据卷宿主机路径 | `/data/volumes/adminer` |
## 访问服务
- 默认端口:`8080`
- 访问地址:`http://<主机IP>:8080`
## 注意事项
- Adminer 本身无持久化数据,容器重建不影响使用
- 连接数据库时使用数据库容器的服务名或内网 IP而非 localhost
- 建议仅在内部网络使用,不要直接暴露到公网

15
adminer/stack.yml Normal file
View File

@@ -0,0 +1,15 @@
# pull:: docker compose -p adminer --env-file ./adminer/env.cfg -f ./adminer/stack.yml pull
# run:: docker compose -p adminer --env-file ./adminer/env.cfg -f ./adminer/stack.yml up -d
services:
adminer:
image: ${IMAGE_TAG}
container_name: adminer
restart: unless-stopped
ports:
- '8080:8080'
environment:
- TZ=Asia/Shanghai
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro