mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 12:21:17 +00:00
Continue to fix format issues
This commit is contained in:
@@ -8,23 +8,27 @@
|
||||
|
||||
如图 10-2 所示,Rails 与 PostgreSQL 在同一 Compose 网络中协同工作。
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ Docker Compose 网络 │
|
||||
│ │
|
||||
│ ┌─────────────────────┐ ┌─────────────────────┐ │
|
||||
│ │ web 服务 │ │ db 服务 │ │
|
||||
│ │ ┌───────────────┐ │ │ ┌───────────────┐ │ │
|
||||
│ │ │ Rails │ │──────│ │ PostgreSQL │ │ │
|
||||
│ │ │ 应用 │ │ :5432│ │ 数据库 │ │ │
|
||||
│ │ └───────────────┘ │ │ └───────────────┘ │ │
|
||||
│ │ :3000 │ │ │ │
|
||||
│ └──────────┬──────────┘ └─────────────────────┘ │
|
||||
│ │ │
|
||||
└─────────────┼───────────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
localhost:3000
|
||||
```mermaid
|
||||
flowchart TD
|
||||
subgraph Network ["Docker Compose 网络"]
|
||||
direction LR
|
||||
subgraph Web ["web 服务"]
|
||||
direction TB
|
||||
Rails["Rails<br/>应用"]
|
||||
Port3000[":3000"]
|
||||
Rails ~~~ Port3000
|
||||
end
|
||||
|
||||
subgraph DB ["db 服务"]
|
||||
direction TB
|
||||
Postgres["PostgreSQL<br/>数据库"]
|
||||
end
|
||||
|
||||
Rails -- ":5432" --> Postgres
|
||||
end
|
||||
|
||||
Browser["localhost:3000"]
|
||||
Port3000 --> Browser
|
||||
```
|
||||
|
||||
图 10-2 Rails + PostgreSQL 的 Compose 架构
|
||||
|
||||
Reference in New Issue
Block a user