Ports & Networking
Default Port Mappings
| Service | Container Port | Host Port | Protocol |
|---|---|---|---|
Go API (api) | 8080 | 8088 | HTTP |
PostgreSQL (db) | 5432 | 5432 | TCP |
Next.js (web) | 3000 | 3300 | HTTP |
Changing Host Ports
Edit the ports section in docker-compose.yml (or docker-compose.test.yml):
# Change the API host port to 9090api: ports: - "9090:8080" # host:containerIf you change the API host port, also update NEXT_PUBLIC_API_URL on the web service:
web: environment: NEXT_PUBLIC_API_URL: http://localhost:9090Docker Network
Docker Compose automatically creates a bridge network for the stack’s services. No manual network creation is required.
Service Discovery
Within the compose stack, services are reachable by their service name. From outside the stack (devcontainer or host), use published ports:
| From | To | URL |
|---|---|---|
api | db | db:5432 |
web | api | app:8080 |
| Dev container | api | host.docker.internal:8088 |
| Dev container | db | host.docker.internal:5432 |
| Host browser | api | localhost:8088 |
| Host browser | web | localhost:3300 |
Dev Container Integration
The dev container runs on its own bridge network and reaches compose services via host.docker.internal and published ports. No shared network configuration is needed — the devcontainer and compose stack are fully independent.
Firewall Considerations
If you’re exposing MemGhost on your local network, ensure these host ports are accessible:
- 8088 (API) — needed if other devices on your network need API access
- 3300 (Frontend) — needed for accessing the web UI from other devices
For a reverse proxy setup (e.g., Traefik, Caddy, nginx), point the proxy at the container ports directly on the Docker network rather than the host ports.
Optional Services
| Service | Port | Description |
|---|---|---|
| OpenFGA | 8081 | Authorization service (if enabled) |
| Zipkin | 9411 | Distributed tracing (if enabled) |