-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
97 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,76 @@ | ||
# ------------------------- | ||
# Environment Configuration | ||
# ------------------------- | ||
ENVIRONMENT=development | ||
|
||
# ---------------- | ||
# Database Config | ||
# ---------------- | ||
DB_DRIVER=pgx | ||
DB_SOURCE=postgresql://root:secret@localhost:5432/eenergy?sslmode=disable | ||
DB_USER=root | ||
DB_PASSWORD=secret | ||
DB_NAME=eenergy | ||
DB_PORT=5432 | ||
DB_HOST=localhost | ||
DB_SSL_MODE=disable | ||
DB_SOURCE="postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=${DB_SSL_MODE}" | ||
MIGRATIONS_URL=file://db/migrations | ||
HTTP_SERVER_ADDRESS=0.0.0.0:8080 | ||
GRPC_SERVER_ADDRESS=0.0.0.0:9091 | ||
|
||
# -------------------- | ||
# Server Configuration | ||
# -------------------- | ||
SERVER_IP=0.0.0.0 | ||
HTTP_SERVER_PORT=8080 | ||
GRPC_SERVER_PORT=9091 | ||
HTTP_SERVER_ADDRESS="${SERVER_IP}:${HTTP_SERVER_PORT}" | ||
GRPC_SERVER_ADDRESS="${SERVER_IP}:${GRPC_SERVER_PORT}" | ||
|
||
# ---------------------- | ||
# Security Configuration | ||
# ---------------------- | ||
TOKEN_SYMMETRIC_KEY=B51FE30989F143F6F07D2CB828495D69 | ||
ACCESS_TOKEN_DURATION=15m | ||
REFRESH_TOKEN_DURATION=24h | ||
REDIS_ADDRESS=0.0.0.0:6379 | ||
|
||
# --------------- | ||
# Redis Config | ||
# --------------- | ||
REDIS_HOST=redis | ||
REDIS_PORT=6379 | ||
REDIS_ADDRESS="${REDIS_HOST}:${REDIS_PORT}" | ||
|
||
# --------------- | ||
# Email Configuration | ||
# --------------- | ||
EMAIL_SENDER_NAME=eenergy | ||
EMAIL_SENDER_ADDRESS=[email protected] | ||
EMAIL_SENDER_PASSWORD= | ||
|
||
# ------------------------- | ||
# Certificates Path Config | ||
# ------------------------- | ||
SERVER_CRT_PATH=dev-certs/server.crt | ||
SERVER_KEY_PATH=dev-certs/server.key | ||
CA_CRT_PATH=dev-certs/ca.pem | ||
|
||
# OpenTelemetry Collector | ||
# ------------------------------- | ||
# OpenTelemetry Collector Config | ||
# ------------------------------- | ||
OTEL_COLLECTOR_HOST=otel-collector | ||
OTEL_COLLECTOR_PORT_GRPC=4317 | ||
OTEL_COLLECTOR_PORT_HTTP=4318 | ||
OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC} | ||
PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:8080/otlp-http/v1/traces | ||
OTEL_SERVICE_NAME=eenergy-api | ||
|
||
# Jaeger | ||
# ----------- | ||
# Jaeger Config | ||
# ----------- | ||
JAEGER_SERVICE_PORT=16686 | ||
JAEGER_SERVICE_HOST=jaeger | ||
|
||
# Prometheus | ||
# --------------- | ||
# Prometheus Config | ||
# --------------- | ||
PROMETHEUS_SERVICE_PORT=9090 | ||
PROMETHEUS_SERVICE_HOST=prometheus | ||
PROMETHEUS_ADDR=${PROMETHEUS_SERVICE_HOST}:${PROMETHEUS_SERVICE_PORT} |
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
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,14 +1,13 @@ | ||
|
||
services: | ||
postgres: | ||
container_name: postgres | ||
image: postgis/postgis:16-3.4-alpine | ||
environment: | ||
- POSTGRES_DB=eenergy | ||
- POSTGRES_USER=root | ||
- POSTGRES_PASSWORD=secret | ||
- POSTGRES_DB=${DB_NAME} | ||
- POSTGRES_USER=${DB_USER} | ||
- POSTGRES_PASSWORD=${DB_PASSWORD} | ||
ports: | ||
- "5432:5432" | ||
- "${DB_PORT}:${DB_PORT}" | ||
volumes: | ||
- data-volume:/var/lib/postgresql/data | ||
healthcheck: | ||
|
@@ -18,7 +17,6 @@ services: | |
retries: 5 | ||
|
||
pgadmin4: | ||
container_name: pgadmin4 | ||
image: dpage/pgadmin4 | ||
environment: | ||
- [email protected] | ||
|
@@ -27,31 +25,28 @@ services: | |
- "80:80" | ||
|
||
redis: | ||
container_name: redis | ||
image: redis:7-alpine | ||
ports: | ||
- "6379:6379" | ||
- "${REDIS_PORT}:${REDIS_PORT}" | ||
healthcheck: | ||
test: ["CMD", "redis-cli", "ping"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
api: | ||
container_name: api | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- 8080:8080 | ||
- 9091:9091 | ||
- ${HTTP_SERVER_PORT}:${HTTP_SERVER_PORT} | ||
- ${GRPC_SERVER_PORT}:${GRPC_SERVER_PORT} | ||
environment: | ||
- DB_SOURCE=postgresql://root:secret@postgres:5432/eenergy?sslmode=disable | ||
- REDIS_ADDRESS=redis:6379 | ||
- OTEL_EXPORTER_OTLP_ENDPOINT | ||
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE | ||
- OTEL_RESOURCE_ATTRIBUTES | ||
- OTEL_SERVICE_NAME=eenergy | ||
- OTEL_SERVICE_NAME | ||
|
||
depends_on: | ||
postgres: # Wait for postgres to start | ||
|
@@ -63,7 +58,6 @@ services: | |
|
||
# logs containers | ||
loki: | ||
container_name: loki | ||
image: grafana/loki:latest | ||
ports: | ||
- "3100:3100" | ||
|
@@ -74,7 +68,6 @@ services: | |
- ./observability/loki/rules:/loki/rules/fake | ||
|
||
alertmanager: | ||
container_name: alertmanager | ||
image: prom/alertmanager:latest | ||
volumes: | ||
- ./alertmanager.yml:/etc/alertmanager/alertmanager.yml | ||
|
@@ -87,7 +80,6 @@ services: | |
- prometheus | ||
|
||
promtail: | ||
container_name: promtail | ||
image: grafana/promtail:latest | ||
volumes: | ||
- ./promtail-config.yml:/etc/promtail/promtail.yml | ||
|
@@ -98,7 +90,6 @@ services: | |
- loki | ||
|
||
grafana: | ||
container_name: grafana | ||
image: grafana/grafana:latest | ||
ports: | ||
- "3000:3000" | ||
|
@@ -109,7 +100,6 @@ services: | |
|
||
# metrics containers | ||
prometheus: | ||
container_name: prometheus | ||
image: prom/prometheus:latest | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
|
@@ -119,7 +109,6 @@ services: | |
# traces containes | ||
# Jaeger | ||
jaeger: | ||
container_name: jaeger | ||
image: jaegertracing/all-in-one:latest | ||
ports: | ||
- "${JAEGER_SERVICE_PORT}" # Jaeger UI | ||
|
@@ -128,7 +117,6 @@ services: | |
- COLLECTOR_OTLP_ENABLED=true | ||
|
||
otel-collector: | ||
container_name: otel-collector | ||
image: otel/opentelemetry-collector-contrib | ||
volumes: | ||
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml | ||
|
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