Fix build command in Dockerfile
This commit is contained in:
+4
-4
@@ -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"]
|
||||
|
||||
+3
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user