feat(deploy): add docker

This commit is contained in:
2026-02-11 16:30:54 +08:00
parent 03a1e6043d
commit d44a69bdaa
9 changed files with 230 additions and 27 deletions

43
deploy/README.md Normal file
View File

@@ -0,0 +1,43 @@
# IAM Front Deployment Guide
## 1. Prerequisites
- Docker & Docker Compose installed
- `iam-service` running (and accessible from this host)
- `.env` file configured (copied from `.env.example`)
## 2. Configuration (.env)
Ensure `.env` exists in `iam-front/` root.
**Critical Variables:**
- `IAM_SERVICE_BASE_URL`: URL to access iam-service.
- **Docker Note**: Do NOT use `localhost` or `127.0.0.1`. Use the host IP (e.g. `http://192.168.1.100:3000`).
- `CAPTCHA_SECRET`: Secure random string for cookie signing.
- `PORT`: Optional, defaults to 6020.
## 3. Deploy
```bash
cd deploy/docker
bash start.sh
```
This will:
1. Validate `.env` configuration (checks for localhost issues).
2. Build the Docker image.
3. Start the container with ports mapped (default 6020).
## 4. Stop
```bash
cd deploy/docker
bash stop.sh
```
## 5. Notes
- This deployment only includes the `iam-front` service.
- It assumes `iam-service` is deployed separately.
- No database or Redis is required for the frontend.