Fix build command in Dockerfile
This commit is contained in:
+4
-4
@@ -17,7 +17,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build binaries
|
# 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
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o restserver ./cmd/restserver
|
||||||
|
|
||||||
# Runtime stage
|
# Runtime stage
|
||||||
@@ -34,7 +34,7 @@ RUN addgroup -g 1000 notifier && \
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy binaries from builder
|
# Copy binaries from builder
|
||||||
COPY --from=builder /build/grpcserver /app/
|
COPY --from=builder /build/server /app/
|
||||||
COPY --from=builder /build/restserver /app/
|
COPY --from=builder /build/restserver /app/
|
||||||
|
|
||||||
# Copy default config (can be overridden with volume mount)
|
# Copy default config (can be overridden with volume mount)
|
||||||
@@ -50,6 +50,6 @@ USER notifier
|
|||||||
# Expose ports
|
# Expose ports
|
||||||
EXPOSE 8080 50051 9090 8081
|
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
|
# 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:
|
ports:
|
||||||
- "8080:8080" # REST API
|
- "8080:8080" # REST API
|
||||||
- "50051:50051" # gRPC
|
- "50051:50051" # gRPC
|
||||||
- "9090:9090" # Metrics
|
- "9090:9090" # Metrics (future)
|
||||||
- "8081:8081" # Health check
|
- "8081:8081" # Health check (future)
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.yaml:/app/config.yaml:ro
|
- ./config.yaml:/app/config.yaml:ro
|
||||||
- notifier-data:/var/lib/notifier
|
- notifier-data:/var/lib/notifier
|
||||||
environment:
|
environment:
|
||||||
- NOTIFIER_SERVER_MODE=both
|
- NOTIFIER_SERVER_MODE=both
|
||||||
- NOTIFIER_LOGGING_LEVEL=info
|
- NOTIFIER_LOGGING_LEVEL=info
|
||||||
- NOTIFIER_LOGGING_FORMAT=json
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- notifier-net
|
- notifier-net
|
||||||
healthcheck:
|
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
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user