feat(docker): Add API Gateway to Docker Compose
- Create Dockerfile for API Gateway - Multi-stage build using golang:1.25-alpine - Minimal runtime image using alpine:latest - Exposes port 8080 - Add API Gateway service to docker-compose.yml - Depends on Consul and all core services - Environment variables for gateway configuration - Port 8080 exposed - Update SUMMARY.md - Add API Gateway to service list - Add API Gateway to Docker build instructions - Update file structure to include API Gateway Dockerfile
This commit is contained in:
@@ -121,6 +121,34 @@ services:
|
|||||||
- goplt-network
|
- goplt-network
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
api-gateway:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: cmd/api-gateway/Dockerfile
|
||||||
|
container_name: goplt-api-gateway
|
||||||
|
environment:
|
||||||
|
ENVIRONMENT: production
|
||||||
|
REGISTRY_TYPE: consul
|
||||||
|
REGISTRY_CONSUL_ADDRESS: "consul:8500"
|
||||||
|
GATEWAY_PORT: "8080"
|
||||||
|
GATEWAY_HOST: "0.0.0.0"
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
depends_on:
|
||||||
|
consul:
|
||||||
|
condition: service_healthy
|
||||||
|
auth-service:
|
||||||
|
condition: service_started
|
||||||
|
identity-service:
|
||||||
|
condition: service_started
|
||||||
|
authz-service:
|
||||||
|
condition: service_started
|
||||||
|
audit-service:
|
||||||
|
condition: service_started
|
||||||
|
networks:
|
||||||
|
- goplt-network
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
driver: local
|
driver: local
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ This will start:
|
|||||||
- Identity Service (port 8082)
|
- Identity Service (port 8082)
|
||||||
- Authz Service (port 8083)
|
- Authz Service (port 8083)
|
||||||
- Audit Service (port 8084)
|
- Audit Service (port 8084)
|
||||||
|
- API Gateway (port 8080)
|
||||||
|
|
||||||
### Infrastructure Services
|
### Infrastructure Services
|
||||||
|
|
||||||
@@ -423,9 +424,12 @@ goplt/
|
|||||||
│ │ ├── main.go
|
│ │ ├── main.go
|
||||||
│ │ ├── authz_service_fx.go
|
│ │ ├── authz_service_fx.go
|
||||||
│ │ └── Dockerfile
|
│ │ └── Dockerfile
|
||||||
│ └── audit-service/
|
│ ├── audit-service/
|
||||||
|
│ │ ├── main.go
|
||||||
|
│ │ ├── audit_service_fx.go
|
||||||
|
│ │ └── Dockerfile
|
||||||
|
│ └── api-gateway/
|
||||||
│ ├── main.go
|
│ ├── main.go
|
||||||
│ ├── audit_service_fx.go
|
|
||||||
│ └── Dockerfile
|
│ └── Dockerfile
|
||||||
├── docker-compose.yml
|
├── docker-compose.yml
|
||||||
├── docker-compose.dev.yml
|
├── docker-compose.dev.yml
|
||||||
@@ -473,6 +477,7 @@ docker build -f cmd/auth-service/Dockerfile -t goplt-auth-service:latest .
|
|||||||
docker build -f cmd/identity-service/Dockerfile -t goplt-identity-service:latest .
|
docker build -f cmd/identity-service/Dockerfile -t goplt-identity-service:latest .
|
||||||
docker build -f cmd/authz-service/Dockerfile -t goplt-authz-service:latest .
|
docker build -f cmd/authz-service/Dockerfile -t goplt-authz-service:latest .
|
||||||
docker build -f cmd/audit-service/Dockerfile -t goplt-audit-service:latest .
|
docker build -f cmd/audit-service/Dockerfile -t goplt-audit-service:latest .
|
||||||
|
docker build -f cmd/api-gateway/Dockerfile -t goplt-api-gateway:latest .
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker Compose Files
|
### Docker Compose Files
|
||||||
|
|||||||
Reference in New Issue
Block a user