Files
ssh-manager/docker/README.md

36 lines
933 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Docker 单容器部署
前端打包后放入 Spring Boot `static`,与 Java 一起在同一个容器内启动,不使用 Nginx。
## 国内源
- **npm**`docker/.npmrc` 使用 npmmirror淘宝镜像
- **Maven**`docker/maven-settings.xml` 使用阿里云仓库
## 构建与运行
在**项目根目录**执行:
```bash
# 构建镜像
docker compose -f docker/docker-compose.yml build
# 前台运行
docker compose -f docker/docker-compose.yml up
# 后台运行
docker compose -f docker/docker-compose.yml up -d
```
访问http://localhost:48080
## 环境变量(可选)
- `SSHMANAGER_ENCRYPTION_KEY`:连接密码加密密钥(生产务必修改)
- `SSHMANAGER_JWT_SECRET`JWT 密钥(生产务必修改)
- `TZ`:时区,默认 `Asia/Shanghai`
## 数据持久化
H2 数据目录通过 volume `app-data` 挂载到 `/app/data`,重启容器数据保留。