From 5ea1ff2965fc887dd15e2fbce05a2230854d6f0a Mon Sep 17 00:00:00 2001 From: Kumaran Rajendhiran Date: Thu, 20 Jun 2024 14:20:00 +0530 Subject: [PATCH] Use a service specific docker compose file name --- docker-compose.yaml => google-sheets-docker-compose.yaml | 2 +- scripts/deploy.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename docker-compose.yaml => google-sheets-docker-compose.yaml (93%) diff --git a/docker-compose.yaml b/google-sheets-docker-compose.yaml similarity index 93% rename from docker-compose.yaml rename to google-sheets-docker-compose.yaml index 7a466b3..c0aabd6 100644 --- a/docker-compose.yaml +++ b/google-sheets-docker-compose.yaml @@ -6,7 +6,7 @@ services: image: ghcr.io/${GITHUB_REPOSITORY}:${TAG} container_name: ${container_name} ports: - - "8000:8000" + - "8001:8000" environment: - DOMAIN=${DOMAIN} networks: diff --git a/scripts/deploy.sh b/scripts/deploy.sh index cd45fe8..fb3ad21 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -32,11 +32,11 @@ $ssh_command "docker logs $container_name >> $log_file 2>&1 || echo 'No containe $ssh_command "if [ \$(stat -c%s \"$log_file\") -ge 1073741824 ]; then echo 'Log file size exceeds 1GB, trimming...'; tail -c 1073741824 \"$log_file\" > \"$log_file.tmp\" && mv \"$log_file.tmp\" \"$log_file\"; fi" echo "INFO: stopping already running docker containers" -$ssh_command "export PORT='$PORT' && docker compose down || echo 'No containers available to stop'" +$ssh_command "export PORT='$PORT' && docker compose -f google-sheets-docker-compose.yaml down || echo 'No containers available to stop'" $ssh_command "docker container prune -f || echo 'No stopped containers to delete'" -echo "INFO: SCPing docker-compose.yaml" -scp -i key.pem ./docker-compose.yaml azureuser@$DOMAIN:/home/azureuser/docker-compose.yaml +echo "INFO: SCPing google-sheets-docker-compose.yaml" +scp -i key.pem ./google-sheets-docker-compose.yaml azureuser@$DOMAIN:/home/azureuser/google-sheets-docker-compose.yaml echo "INFO: pulling docker image" $ssh_command "echo $GITHUB_PASSWORD | docker login -u '$GITHUB_USERNAME' --password-stdin '$REGISTRY'" @@ -50,4 +50,4 @@ echo "INFO: starting docker containers" $ssh_command "export GITHUB_REPOSITORY='$GITHUB_REPOSITORY' TAG='$TAG' container_name='$container_name' \ DOMAIN='$DOMAIN' \ - && docker compose up -d" + && docker compose -f google-sheets-docker-compose.yaml up -d"