Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Comment thread
Baibhab23 marked this conversation as resolved.
Resolved
Comment thread
Baibhab23 marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
# Run backend containers
# Run containers

## App stack only
## App stack (backend + UI)

From project root, build and start the application and database:
From project root, build and start all services — backend, database, Keycloak, feature flags, and the UI:
```bash
docker build -t pipeline-app .
docker compose --env-file .env.local up -d
docker compose --env-file .env.local up -d --build --wait
```

Services available at:
- Pipeline UI: http://localhost:3000
- Pipeline API: http://localhost:8080
- Keycloak: http://localhost:8180

This build uses the `dev` target — a lighter image without the OpenTelemetry agent.

## App stack + monitoring

Starts the app stack together with the full monitoring stack (Grafana, Loki, Prometheus, Alloy). All services start in dependency order automatically:
Runs all backend services and adds the monitoring stack (Grafana, Loki, Prometheus, Alloy). The pipeline app is rebuilt with the `monitoring` target, which includes the OpenTelemetry Java agent:
```bash
docker build -t pipeline-app .
MONITORING_STACK_DIR=./monitoring \
docker compose --env-file .env.local \
-f docker-compose.yml \
-f monitoring/docker-compose-monitoring.yml \
-f monitoring/docker-compose-monitoring-integration.yml \
up -d
up -d --build --wait
```

Monitoring UIs available at:
- Grafana: http://localhost:3000
- Grafana: http://localhost:3001
- Alloy: http://localhost:12345
- Prometheus: http://localhost:9090

Expand All @@ -40,11 +46,6 @@ docker compose \
down
```

An easier command to do the same would be,
```bash
docker compose -p autobuild down
```

## Fresh instance

```bash
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ services:
- "8016:8016"
networks:
- app
healthcheck:
disable: true
pipeline-app:
build:
context: .
dockerfile: pipeline/Dockerfile
target: dev
image: pipeline-app
container_name: pipeline-app
environment:
Expand Down
4 changes: 4 additions & 0 deletions monitoring/docker-compose-monitoring-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ services:
condition: service_started

pipeline-app:
build:
context: .
dockerfile: pipeline/Dockerfile
target: monitoring
environment:
OTEL_EXPORTER_OTLP_ENDPOINT: http://alloy:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
Expand Down
2 changes: 1 addition & 1 deletion monitoring/docker-compose-monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
- GF_AUTH_BASIC_ENABLED=false
- GF_INSTALL_PLUGINS=grafana-lokiexplore-app
ports:
- 3000:3000/tcp
- 3001:3000/tcp
volumes:
- ${MONITORING_STACK_DIR:-.}/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasources.yml
- grafana_data:/var/lib/grafana
Expand Down
29 changes: 24 additions & 5 deletions pipeline/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
#
# Build stage
# Dev build stage
#
FROM maven:3.9.6-eclipse-temurin-17 AS build
WORKDIR /home/app
COPY pipeline/pom.xml .
COPY pipeline/src ./src
COPY apis/protobuf /home/apis/protobuf
RUN mvn clean package -DskipTests

#
# Monitoring build stage
#
FROM maven:3.9.6-eclipse-temurin-17 AS build-monitoring
WORKDIR /home/app
COPY pipeline/pom.xml .
COPY pipeline/src ./src
COPY apis/protobuf /home/apis/protobuf
RUN mvn clean package -DskipTests -Pmonitoring

#
# Runtime stage
# Monitoring runtime target
#
FROM eclipse-temurin:17-jdk-jammy
FROM eclipse-temurin:17-jdk-jammy AS monitoring
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
WORKDIR /app
COPY --from=build /home/app/target/pipeline*.jar app.jar
COPY --from=build /home/app/target/agents/opentelemetry-javaagent.jar otel-agent.jar
COPY --from=build-monitoring /home/app/target/pipeline*.jar app.jar
COPY --from=build-monitoring /home/app/target/agents/opentelemetry-javaagent.jar otel-agent.jar
EXPOSE 8080
ENTRYPOINT ["java", "-javaagent:otel-agent.jar", "-jar", "app.jar"]

#
# Dev runtime target
#
FROM eclipse-temurin:17-jdk-jammy AS dev
WORKDIR /app
COPY --from=build /home/app/target/pipeline*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
Loading