Skip to content

Commit

Permalink
Use a service specific docker compose file name
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed Jun 20, 2024
1 parent eb68004 commit 5ea1ff2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yaml → google-sheets-docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
image: ghcr.io/${GITHUB_REPOSITORY}:${TAG}
container_name: ${container_name}
ports:
- "8000:8000"
- "8001:8000"
environment:
- DOMAIN=${DOMAIN}
networks:
Expand Down
8 changes: 4 additions & 4 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand All @@ -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"

0 comments on commit 5ea1ff2

Please sign in to comment.