58 lines
790 B
Markdown
58 lines
790 B
Markdown
|
|
# 07_networks.md
|
||
|
|
|
||
|
|
# Networks
|
||
|
|
|
||
|
|
## Grundregel
|
||
|
|
|
||
|
|
```text
|
||
|
|
localhost im Container = derselbe Container.
|
||
|
|
Interne Services über Service-Namen ansprechen.
|
||
|
|
```
|
||
|
|
|
||
|
|
Richtig:
|
||
|
|
|
||
|
|
```text
|
||
|
|
postgres:5432
|
||
|
|
redis:6379
|
||
|
|
api:3000
|
||
|
|
```
|
||
|
|
|
||
|
|
Falsch:
|
||
|
|
|
||
|
|
```text
|
||
|
|
localhost:5432
|
||
|
|
127.0.0.1:6379
|
||
|
|
```
|
||
|
|
|
||
|
|
## Netzwerktypen
|
||
|
|
|
||
|
|
```text
|
||
|
|
Coolify Default Network
|
||
|
|
Compose Project Network
|
||
|
|
External/Predefined Network
|
||
|
|
Host Network
|
||
|
|
Proxy Network
|
||
|
|
```
|
||
|
|
|
||
|
|
## Host Network
|
||
|
|
|
||
|
|
Nur mit Begründung:
|
||
|
|
|
||
|
|
```text
|
||
|
|
Discovery, Monitoring, Spezialprotokolle.
|
||
|
|
```
|
||
|
|
|
||
|
|
Risiken: Isolation, Portkonflikte, Portabilität.
|
||
|
|
|
||
|
|
## Cross-Resource
|
||
|
|
|
||
|
|
Für Kommunikation zwischen Resources:
|
||
|
|
|
||
|
|
```text
|
||
|
|
predefined/external network
|
||
|
|
feste Service-Namen
|
||
|
|
keine zufälligen container_name-Hacks
|
||
|
|
```
|
||
|
|
|
||
|
|
Stop, wenn interne Kommunikation, Proxy-Reachability oder Host-Network-Bedarf unklar sind.
|