From df7006d4a448f382740e5f7d1fc3771a0b896779 Mon Sep 17 00:00:00 2001 From: heesane Date: Thu, 28 Nov 2024 16:45:17 +0900 Subject: [PATCH] refactoring --- docker/back/docker-compose.back.yml | 10 ++--- docker/devops/docker-compose.devops.yml | 51 +++++------------------ docker/logging/docker-compose.logging.yml | 5 --- 3 files changed, 16 insertions(+), 50 deletions(-) diff --git a/docker/back/docker-compose.back.yml b/docker/back/docker-compose.back.yml index 7e09bec..0b63912 100644 --- a/docker/back/docker-compose.back.yml +++ b/docker/back/docker-compose.back.yml @@ -13,7 +13,7 @@ services: SPRING_DATASOURCE_PASSWORD: 1234 SPRING_PROFILES_ACTIVE: prod volumes: - - spring-log:/logs + - spring_log:/logs networks: - home_network labels: @@ -33,7 +33,7 @@ services: SPRING_DATASOURCE_PASSWORD: 1234 SPRING_PROFILES_ACTIVE: prod volumes: - - spring-log:/logs + - spring_log:/logs networks: - home_network discord: @@ -48,7 +48,7 @@ services: SPRING_DATASOURCE_PASSWORD: 1234 SPRING_PROFILES_ACTIVE: prod volumes: - - spring-log:/logs + - spring_log:/logs networks: - home_network @@ -57,9 +57,9 @@ networks: external: true volumes: - spring-log: + spring_log: driver: local driver_opts: o: bind type: none - device: ./home_server/logs + device: ./docker/home_server/logs diff --git a/docker/devops/docker-compose.devops.yml b/docker/devops/docker-compose.devops.yml index ad46041..ada45a4 100644 --- a/docker/devops/docker-compose.devops.yml +++ b/docker/devops/docker-compose.devops.yml @@ -1,18 +1,11 @@ -version: "3.8" - volumes: - portainer: - driver: local - traefik-certificates: portainer_data: grafana_data: traefik_logs: - npm_logs: - driver: local - driver_opts: - type: none - device: ./nginx-proxy-manager/data/logs - o: bind + npm_data: + npm_certificates: + prometheus_data: + jenkins_data: networks: @@ -30,8 +23,8 @@ services: - '81:81' - '443:443' volumes: - - ./nginx-proxy-manager/data:/data - - ./nginx-proxy-manager/letsencrypt:/etc/letsencrypt + - npm_data:/data + - npm_certificates:/etc/letsencrypt networks: - home_network @@ -55,15 +48,10 @@ services: - "9000:9000" restart: always volumes: - - portainer:/data - /var/run/docker.sock:/var/run/docker.sock + - portainer_data:/data networks: - home_network - # labels: - # - "traefik.enable=true" - # - "traefik.http.routers.portainer.rule=Host(`portainer.heesang.pro`)" - # - "traefik.http.routers.portainer.entrypoints=web" - # - "traefik.http.services.portainer.loadbalancer.server.port=9000" grafana: image: grafana/grafana:latest @@ -75,21 +63,16 @@ services: ports: - "3000:3000" volumes: - - ./grafana:/var/lib/grafana + - grafana_data:/var/lib/grafana networks: - home_network - # labels: - # - "traefik.enable=true" - # - "traefik.http.routers.grafana.rule=Host(`monitoring.heesang.pro`)" - # - "traefik.http.routers.grafana.entrypoints=web" - # - "traefik.http.services.grafana.loadbalancer.server.port=3000" prometheus: image: prom/prometheus container_name: prometheus volumes: - ./prometheus/config:/etc/prometheus - - ./prometheus/volume:/prometheus + - prometheus_data:/prometheus ports: - "9090:9090" command: @@ -102,11 +85,6 @@ services: restart: always networks: - home_network - # labels: - # - "traefik.enable=true" - # - "traefik.http.routers.prometheus.rule=Host(`prometheus.heesang.pro`)" - # - "traefik.http.routers.prometheus.entrypoints=web" - # - "traefik.http.services.prometheus.loadbalancer.server.port=9090" node-exporter: image: prom/node-exporter:latest @@ -153,13 +131,6 @@ services: - "8090:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock # 중요! 호스트 도커 연결 - - ./jenkins:/var/jenkins_home + - jenkins_data:/var/jenkins_home networks: - - home_network - # labels: - # - "traefik.enable=true" - # - "traefik.http.routers.jenkins.rule=Host(`jenkins.heesang.pro`)" # jenkins.heesang.pro 도메인 매핑 - # - "traefik.http.routers.jenkins.entrypoints=web" # Traefik의 웹 엔트리포인트 사용 - # - "traefik.http.services.jenkins.loadbalancer.server.port=8080" # Jenkins 컨테이너의 내부 포트 지정 - - + - home_network \ No newline at end of file diff --git a/docker/logging/docker-compose.logging.yml b/docker/logging/docker-compose.logging.yml index 7035570..9801459 100644 --- a/docker/logging/docker-compose.logging.yml +++ b/docker/logging/docker-compose.logging.yml @@ -57,11 +57,6 @@ services: - elk depends_on: - elasticsearch - # labels: - # - "traefik.enable=true" - # - "traefik.http.routers.kibana.rule=Host(`kibana.heesang.pro`)" - # - "traefik.http.routers.kibana.entrypoints=web" - # - "traefik.http.services.kibana.loadbalancer.server.port=5601" restart: unless-stopped filebeat: