diff --git a/deploy/deploy-stg.sh b/deploy/deploy-stg.sh index e3cef47d..404d5ddf 100755 --- a/deploy/deploy-stg.sh +++ b/deploy/deploy-stg.sh @@ -43,22 +43,25 @@ ssh $SERVER \ # Create .env file for go-app if it doesn't exist ENV_PATH="/home/cmc/$STAGING_DIR/go-app/.env" - if [ ! -f "$ENV_PATH" ]; then - echo "Creating .env file for go-app..." - cat > "$ENV_PATH" <<'ENVEOF' + echo "(Re)creating .env file for go-app..." + cat > "$ENV_PATH" <<'ENVEOF' +# Database configuration +DB_HOST=db +DB_PORT=3306 +DB_USER=cmc +DB_PASSWORD=xVRQI&cA?7AU=hqJ!%au +DB_NAME=cmc + +# Root database password (for dbshell-root) +DB_ROOT_PASSWORD=secureRootPassword + # Environment variables for Go app mail configuration SMTP_HOST="host.docker.internal" SMTP_PORT=1025 SMTP_USER="" SMTP_PASS="" SMTP_FROM="CMC Sales " -DB_HOST="172.17.0.1" -DB_PORT="3306" -DB_USER="cmc" -DB_PASSWORD="xVRQI&cA?7AU=hqJ!%au" -DB_NAME="cmc" ENVEOF - fi if [[ "$USE_CACHE" == "false" ]]; then echo "Building and starting docker compose for staging (no cache)..."