Skip to content

Commit

Permalink
[feat] 도커 네트워크 연결 (#8)
Browse files Browse the repository at this point in the history
* [feat] puppeteer 환경 설정

* [feat] 배포 후 도커 네트워크 연결

* [feat] 이미지 삭제 시에 네트워크 할당 삭제
  • Loading branch information
sharkslee0 authored Nov 19, 2023
1 parent 6a13c8c commit b377b00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ROOT_PATH="/home/ubuntu/reserving"
CONTAINER="reserving_container"
IMAGE="reserving_image"

NETWORK="my-network"

REGION="ap-northeast-2"
GROUP="ssafy-openthedoor-log-group"
STREAM="reserving-log-stream"
Expand All @@ -15,4 +17,5 @@ docker run \
--log-opt awslogs-region="$REGION" \
--log-opt awslogs-group="$GROUP" \
--log-opt awslogs-stream="$STREAM" \
-dp 3000:3000 --name "$CONTAINER" "$IMAGE"
-dp 3000:3000 --name "$CONTAINER" "$IMAGE"
docker network connect "$NETWORK" "$CONTAINER"
3 changes: 3 additions & 0 deletions scripts/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ STOP_LOG="$ROOT_PATH/stop.log"
CONTAINER="reserving_container"
IMAGE="reserving_image"

NETWORK="my-network"

if docker container inspect "$CONTAINER" >/dev/null 2>&1; then
docker network disconnect "$NETWORK" "$CONTAINER"
echo "container exists locally" >> $STOP_LOG
docker stop "$CONTAINER"
docker rm "$CONTAINER"
Expand Down

0 comments on commit b377b00

Please sign in to comment.