From 4366dde12406c0df2f6ebdd8827343b6eb81d2ba Mon Sep 17 00:00:00 2001 From: Dimo-2562 Date: Mon, 9 Feb 2026 03:49:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20Elasticsearch=20=EB=85=B8=EB=93=9C?= =?UTF-8?q?=20=EC=9D=B4=EB=A6=84=20=EC=A7=80=EC=A0=95=ED=95=98=EC=97=AC=20?= =?UTF-8?q?DNS=20=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/docker-compose.infra.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/docker-compose.infra.yml b/docker/docker-compose.infra.yml index dab7687..41a553e 100644 --- a/docker/docker-compose.infra.yml +++ b/docker/docker-compose.infra.yml @@ -53,11 +53,13 @@ services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:8.18.0 container_name: techfork-elasticsearch + hostname: techfork-elasticsearch restart: always ports: - "9200:9200" - "9300:9300" environment: + - node.name=techfork-elasticsearch - discovery.type=single-node - xpack.security.enabled=false - "ES_JAVA_OPTS=-Xms8g -Xmx8g" From b9f0d9c7186262b4f63d178f4e2ae1a76ec29d45 Mon Sep 17 00:00:00 2001 From: Dimo-2562 Date: Mon, 9 Feb 2026 03:50:40 +0900 Subject: [PATCH 2/2] =?UTF-8?q?deploy:=20docker=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=EB=AA=85=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index a4374fe..09dab0e 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -5,9 +5,9 @@ DEPLOY_DIR="$(cd "$(dirname "$0")/.." && pwd)" STATE_FILE="${DEPLOY_DIR}/.active-color" LOCK_DIR="${DEPLOY_DIR}/.deploy.lock" DOCKER_DIR="${DEPLOY_DIR}/docker" -COMPOSE_INFRA="${DOCKER_DIR}/docker-compose.infra.yml" -COMPOSE_BLUE="${DOCKER_DIR}/docker-compose.blue.yml" -COMPOSE_GREEN="${DOCKER_DIR}/docker-compose.green.yml" +COMPOSE_INFRA="-p techfork-infra -f ${DOCKER_DIR}/docker-compose.infra.yml" +COMPOSE_BLUE="-p techfork-blue -f ${DOCKER_DIR}/docker-compose.blue.yml" +COMPOSE_GREEN="-p techfork-green -f ${DOCKER_DIR}/docker-compose.green.yml" UPSTREAM_CONF="${DOCKER_DIR}/nginx/conf.d/upstream.conf" HEALTH_CHECK_RETRIES=30 @@ -110,7 +110,7 @@ docker network create techfork-network 2>/dev/null || true # Step 2: Start infrastructure log "Starting infrastructure services..." -docker compose -f "$COMPOSE_INFRA" up -d +docker compose $COMPOSE_INFRA up -d log "Waiting for Elasticsearch to be healthy..." timeout 120 bash -c 'until docker exec techfork-elasticsearch curl -sf http://localhost:9200/_cluster/health > /dev/null 2>&1; do sleep 5; done' || { @@ -132,18 +132,18 @@ TARGET_CONTAINER=$(get_container_name "$TARGET_COLOR") # Step 4: Pull new image log "Pulling latest image for ${TARGET_COLOR}..." -docker compose -f "$TARGET_COMPOSE" pull +docker compose $TARGET_COMPOSE pull # Step 5: Start target container log "Starting ${TARGET_COLOR} container..." -docker compose -f "$TARGET_COMPOSE" up -d +docker compose $TARGET_COMPOSE up -d # Step 6: Health check if health_check "$TARGET_CONTAINER"; then log "Target container ${TARGET_CONTAINER} is healthy" else log "ROLLBACK: Stopping failed ${TARGET_COLOR} container..." - docker compose -f "$TARGET_COMPOSE" down + docker compose $TARGET_COMPOSE down log "Rollback complete. Active deployment unchanged: ${ACTIVE_COLOR:-none}" exit 1 fi @@ -158,7 +158,7 @@ sleep 10 if [ -n "$ACTIVE_COLOR" ]; then OLD_COMPOSE=$(get_compose_file "$ACTIVE_COLOR") log "Stopping old ${ACTIVE_COLOR} container..." - docker compose -f "$OLD_COMPOSE" down + docker compose $OLD_COMPOSE down fi # Step 10: Save active color