-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfile and devcontainer.json
- Loading branch information
Showing
9 changed files
with
1,629 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
url: http://prometheus:9090 | ||
isDefault: true | ||
access: proxy | ||
editable: true | ||
|
||
- name: Loki | ||
type: loki | ||
access: proxy | ||
url: http://loki:3100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,104 @@ | ||
version: '3' | ||
version: "3.8" | ||
|
||
services: | ||
app: | ||
build: | ||
|
||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
|
||
volumes: | ||
- ../..:/workspaces:cached | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: sleep infinity | ||
|
||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. | ||
network_mode: service:db | ||
|
||
# Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
# user: root | ||
|
||
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
db: | ||
image: mcr.microsoft.com/mssql/server:2019-latest | ||
networks: | ||
- observability | ||
environment: | ||
OTEL_SERVICE_NAME: tour-of-heroes-api | ||
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4317 | ||
ports: | ||
- "5010:5010" | ||
|
||
db: | ||
image: mcr.microsoft.com/azure-sql-edge | ||
restart: unless-stopped | ||
environment: | ||
SA_PASSWORD: P@ssword | ||
ACCEPT_EULA: Y | ||
networks: | ||
- observability | ||
|
||
jaeger: | ||
image: jaegertracing/all-in-one:latest | ||
ports: | ||
- "16686:16686" # Jaeger UI | ||
command: --query.ui-config=/etc/jaeger/jaeger-ui.json --collector.otlp.enabled=true --prometheus.server-url=http://prometheus:9090 --prometheus.query.support-spanmetrics-connector=true | ||
environment: | ||
METRICS_STORAGE_TYPE: "prometheus" | ||
PROMETHEUS_QUERY_NORMALIZE_CALLS: true | ||
PROMETHEUS_QUERY_NORMALIZE_DURATION: true | ||
volumes: | ||
- "./jaeger-ui.json:/etc/jaeger/jaeger-ui.json" | ||
networks: | ||
- observability | ||
|
||
prometheus: | ||
image: prom/prometheus | ||
ports: | ||
- "9090:9090" | ||
networks: | ||
- observability | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
|
||
loki: | ||
image: grafana/loki:latest | ||
command: -config.file=/mnt/config/loki-config.yml | ||
ports: | ||
- "3100:3100" | ||
networks: | ||
- observability | ||
volumes: | ||
- ./loki-config.yml:/mnt/config/loki-config.yml | ||
|
||
grafana: | ||
image: grafana/grafana | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
GF_AUTH_ANONYMOUS_ENABLED: true | ||
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin | ||
GF_AUTH_DISABLE_LOGIN_FORM: true | ||
volumes: | ||
- ./grafana.ini:/etc/grafana/grafana.ini | ||
- ./datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml | ||
networks: | ||
- observability | ||
|
||
# https://opentelemetry.io/docs/collector/installation/ | ||
otel-collector: | ||
image: otel/opentelemetry-collector-contrib:0.91.0 | ||
command: --config /etc/otelcol/otel-collector-config.yml | ||
volumes: | ||
- ./otel-collector-config.yml:/etc/otelcol/otel-collector-config.yml | ||
ports: | ||
- "4317:4317" | ||
networks: | ||
- observability | ||
|
||
fake-calls: | ||
image: alpine/curl:latest | ||
entrypoint: | ||
- /bin/sh | ||
- -c | ||
- | | ||
sleep 5 | ||
while true; do | ||
curl -s "http://app:5001/api/hero" || true | ||
sleep 0.5 | ||
done | ||
networks: | ||
- observability | ||
depends_on: | ||
- app | ||
|
||
# Add "forwardPorts": ["1433"] to **devcontainer.json** to forward MSSQL locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
networks: | ||
observability: |
Oops, something went wrong.