Remove unused services and clean up docker-compose.yaml for better readability and maintainability.
This commit is contained in:
@@ -351,143 +351,6 @@ services:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- "./redis/data:/bitnami/redis/data"
|
||||
phoenix-health-exporter:
|
||||
image: phxerp/phoenix-health-exporter:alpha
|
||||
container_name: health_exporter
|
||||
restart: unless-stopped
|
||||
# logging:
|
||||
# driver: loki
|
||||
# options:
|
||||
# loki-url: "${LOKI_URL}"
|
||||
# loki-retries: "${LOKI_RETRIES}"
|
||||
# loki-batch-size: "${LOKI_BATCH_SIZE}"
|
||||
# loki-external-labels: "service=phx-health-exporter,env=prod"
|
||||
ports:
|
||||
- "9800:9800"
|
||||
environment:
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_NAME: ${DB_NAME}
|
||||
DB_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
DB_USERNAME: ${DB_USERNAME}
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
volumes:
|
||||
- /etc/hostname:/etc/host_hostname:ro # This ensures the container always uses the real machine hostname, even if restarted or recreated.
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
memswap_limit: 512M
|
||||
deploy:
|
||||
restart_policy: # Define how the service should restart when it fails
|
||||
condition: on-failure # Only restart if the container exits with a non-zero code
|
||||
delay: 5s # Wait 5 seconds before attempting to restart
|
||||
max_attempts: 5 # Maximum number of restart attempts before giving up
|
||||
window: 120s # Time window to evaluate restart attempts (resets counter after this period)
|
||||
resources: # Resource allocation and limits for the container
|
||||
limits: # Maximum resources the container can use
|
||||
cpus: "0.5" # Maximum CPU cores (50% of one core)
|
||||
memory: 256M # Maximum memory usage (256 megabytes)
|
||||
reservations: # Guaranteed minimum resources for the container
|
||||
cpus: "0.1" # Reserved CPU cores (10% of one core)
|
||||
memory: 64M # Reserved memory (64 megabytes)
|
||||
depends_on:
|
||||
phoenix-system:
|
||||
condition: service_healthy
|
||||
phoenix-worker:
|
||||
condition: service_healthy
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -sf http://localhost:9800/healthz || exit 1"]
|
||||
interval: 1m
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
node-exporter:
|
||||
image: quay.io/prometheus/node-exporter:latest
|
||||
container_name: node_exporter
|
||||
# logging:
|
||||
# driver: loki
|
||||
# options:
|
||||
# loki-url: "${LOKI_URL}"
|
||||
# loki-retries: "${LOKI_RETRIES}"
|
||||
# loki-batch-size: "${LOKI_BATCH_SIZE}"
|
||||
# loki-external-labels: "service=phx-node-exporter,env=prod"
|
||||
networks:
|
||||
- metrics
|
||||
- frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9100:9100" # Restrict to only allow access from Grafana Server IP
|
||||
command:
|
||||
- "--path.procfs=/host/proc"
|
||||
- "--path.sysfs=/host/sys"
|
||||
- "--path.rootfs=/host"
|
||||
- "--collector.filesystem.ignored-mount-points=^/(sys|proc|dev)($$|/)"
|
||||
volumes:
|
||||
- "/proc:/host/proc:ro"
|
||||
- "/sys:/host/sys:ro"
|
||||
- "/:/host:ro,rslave"
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
memswap_limit: 512M
|
||||
deploy:
|
||||
restart_policy: # Define how the service should restart when it fails
|
||||
condition: on-failure # Only restart if the container exits with a non-zero code
|
||||
delay: 5s # Wait 5 seconds before attempting to restart
|
||||
max_attempts: 5 # Maximum number of restart attempts before giving up
|
||||
window: 120s # Time window to evaluate restart attempts (resets counter after this period)
|
||||
resources: # Resource allocation and limits for the container
|
||||
limits: # Maximum resources the container can use
|
||||
cpus: "0.25" # Maximum CPU cores (25% of one core)
|
||||
memory: 128M # Maximum memory usage (128 megabytes)
|
||||
reservations: # Guaranteed minimum resources for the container
|
||||
cpus: "0.05" # Reserved CPU cores (5% of one core)
|
||||
memory: 32M # Reserved memory (32 megabytes)
|
||||
depends_on:
|
||||
phoenix-worker: # This is to avoid alocation of resources to the node-exporter if the phoenix-worker is not healthy yet.
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:9100/metrics"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
# nginx-exporter:
|
||||
# image: nginx/nginx-prometheus-exporter:1.4.2
|
||||
# container_name: nginx_exporter
|
||||
# restart: unless-stopped
|
||||
# # logging:
|
||||
# # driver: loki
|
||||
# # options:
|
||||
# # loki-url: "${LOKI_URL}"
|
||||
# # loki-retries: "${LOKI_RETRIES}"
|
||||
# # loki-batch-size: "${LOKI_BATCH_SIZE}"
|
||||
# # loki-external-labels: "service=phx-nginx-exporter,env=prod"
|
||||
# ports:
|
||||
# - "9113:9113" # Restrict to only allow access from Grafana Server IP
|
||||
# command:
|
||||
# - '--nginx.scrape-uri=http://phoenix-app/stub_status'
|
||||
# security_opt:
|
||||
# - no-new-privileges:true
|
||||
# deploy:
|
||||
# resources:
|
||||
# limits:
|
||||
# cpus: '0.25'
|
||||
# memory: 128M
|
||||
# depends_on:
|
||||
# phoenix-app:
|
||||
# condition: service_healthy
|
||||
# networks:
|
||||
# - frontend
|
||||
# - metrics
|
||||
# healthcheck:
|
||||
# test: ["CMD", "wget", "-qO-", "http://localhost:9113/metrics"] # Not working as expected
|
||||
# interval: 15s
|
||||
# timeout: 5s
|
||||
# retries: 3
|
||||
# start_period: 10s
|
||||
|
||||
networks:
|
||||
backend:
|
||||
@@ -503,10 +366,3 @@ networks:
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.20.0.0/16
|
||||
|
||||
metrics:
|
||||
driver: bridge
|
||||
external: false
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.22.0.0/16
|
||||
|
||||
Reference in New Issue
Block a user