diff --git a/Dockerfile b/Dockerfile index 872f2d1..b4e009b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN go mod download COPY . . # Build binaries -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o grpcserver ./cmd/grpcserver +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server ./cmd/server RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o restserver ./cmd/restserver # Runtime stage @@ -34,7 +34,7 @@ RUN addgroup -g 1000 notifier && \ WORKDIR /app # Copy binaries from builder -COPY --from=builder /build/grpcserver /app/ +COPY --from=builder /build/server /app/ COPY --from=builder /build/restserver /app/ # Copy default config (can be overridden with volume mount) @@ -50,6 +50,6 @@ USER notifier # Expose ports EXPOSE 8080 50051 9090 8081 -# Default to running both servers +# Default to running the combined server (handles both REST and gRPC) # Can be overridden with docker run command -CMD ["sh", "-c", "/app/grpcserver & /app/restserver"] +CMD ["/app/server"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 6a50503..f0f6961 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,20 +9,19 @@ services: ports: - "8080:8080" # REST API - "50051:50051" # gRPC - - "9090:9090" # Metrics - - "8081:8081" # Health check + - "9090:9090" # Metrics (future) + - "8081:8081" # Health check (future) volumes: - ./config.yaml:/app/config.yaml:ro - notifier-data:/var/lib/notifier environment: - NOTIFIER_SERVER_MODE=both - NOTIFIER_LOGGING_LEVEL=info - - NOTIFIER_LOGGING_FORMAT=json restart: unless-stopped networks: - notifier-net healthcheck: - test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8081/health"] + test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"] interval: 30s timeout: 10s retries: 3