feat: add minimal frontend and backend CI demo

This commit is contained in:
2026-10-29 08:32:36 +00:00
parent 8b4495cb9f
commit 20182b4dae
6 changed files with 143 additions and 0 deletions

View File

@@ -1,2 +1,18 @@
# test-cicd-1
Repo demo CI có hai Dockerfile để tạo hai service riêng:
| Service | Build context | Dockerfile | Port |
| --- | --- | --- | --- |
| `fe` | `fe` | `Dockerfile` | `8080` |
| `be` | `be` | `Dockerfile` | `8080` |
Trong Console, kết nối repo này, scan branch `main`, chọn cả hai Dockerfile, rồi đặt tên service lần lượt là `fe` và `be`. Cả hai dùng port container `8080`.
FE có trang đơn giản và gọi `GET /api/hello` qua server FE. Để thử kết nối nội bộ, đặt biến môi trường cho service `fe`:
```text
BE_URL=http://be:8080/api/hello
```
Tên host `be` cần khớp tên service và môi trường phải cho phép FE kết nối tới BE. Mỗi service có endpoint kiểm tra sức khỏe tại `/health`.