Auto-generate .env for docker compose commands
The deploy script now creates a .env file with COMPOSE_PROJECT_NAME and BACKEND_PORT so that manual docker compose commands (ps, logs, etc.) work without needing to set environment variables. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
27113a625a
commit
3df1b9fb92
1 changed files with 12 additions and 3 deletions
15
deploy.sh
15
deploy.sh
|
|
@ -43,11 +43,20 @@ if [ -z "$FRONTEND_DEPLOY_DIR" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Export variables for docker compose
|
||||
export COMPOSE_PROJECT_NAME="${COMPOSE_PROJECT_NAME:-modcomms}"
|
||||
export BACKEND_PORT="${BACKEND_PORT:-8000}"
|
||||
# Set defaults for docker compose variables
|
||||
COMPOSE_PROJECT_NAME="${COMPOSE_PROJECT_NAME:-modcomms}"
|
||||
BACKEND_PORT="${BACKEND_PORT:-8000}"
|
||||
echo " Environment: ${COMPOSE_PROJECT_NAME} (port ${BACKEND_PORT})"
|
||||
|
||||
# Create .env file for docker compose (so manual docker compose commands work)
|
||||
cat > .env << EOF
|
||||
# Auto-generated by deploy.sh - do not edit manually
|
||||
# Edit .env.deploy instead and re-run deploy.sh
|
||||
COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}
|
||||
BACKEND_PORT=${BACKEND_PORT}
|
||||
EOF
|
||||
echo " ✓ .env created for docker compose"
|
||||
|
||||
# --- Check backend/.env exists (required for GEMINI_API_KEY) ---
|
||||
if [ ! -f backend/.env ]; then
|
||||
if [ -f backend/.env.example ]; then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue