diff --git a/docker/team-deploy/docker-compose.yml b/docker/team-deploy/docker-compose.yml index 225d0c7f6..276c26557 100644 --- a/docker/team-deploy/docker-compose.yml +++ b/docker/team-deploy/docker-compose.yml @@ -3,5 +3,5 @@ services: image: hngdevops/nextjs-boilerplate:dev ports: - "${PORT}:3000" - env_file: - - ../../.env + volumes: + - ../../.env:/app/.env diff --git a/scripts/team_deploy.sh b/scripts/team_deploy.sh index 14c83e226..c558e020a 100755 --- a/scripts/team_deploy.sh +++ b/scripts/team_deploy.sh @@ -3,23 +3,16 @@ set -e # Check if the team name is provided -if [ -z "$1" ]; then - echo "Error: Team name is required." - echo "Usage: $0 [team name] [port]" - exit 1 -fi - -# Check if the port is provided -if [ -z "$2" ]; then +if [ -z "$1" ] || [ -z "$2" ]; then echo "Error: Port number is required." echo "Usage: $0 [team name] [port]" exit 1 fi -# Assign arguments to variables for clarity TEAM_NAME=$1 export PORT=$2 cd "$(git rev-parse --show-toplevel)" git pull origin dev +docker pull hngdevops/nextjs-boilerplate:dev docker compose --project-name $TEAM_NAME -f docker/team-deploy/docker-compose.yml up -d