Files
cocapwya/New Folder With Items/fix-deployment2.sh
2025-11-05 01:30:03 -08:00

75 lines
1.6 KiB
Bash
Executable File

# Backup old (if needed)
mv docker-compose.yml docker-compose.yml.broken 2>/dev/null || true
# Create validated YAML (arm64-safe, no syntax issues)
cat > docker-compose.yml << 'EOF'
name: nocapwya
services:
db:
image: postgis/postgis:16-3.5
container_name: nocapwya-db
platform: linux/arm64
environment:
POSTGRES_DB: wya
POSTGRES_USER: wya
POSTGRES_PASSWORD: wya
volumes:
- pg_data:/var/lib/postgresql/data
- ./backend/app/init.sql:/docker-entrypoint-initdb.d/init.sql
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wya -d wya"]
interval: 10s
timeout: 5s
retries: 10
networks:
- wya-net
backend:
build:
context: ./backend
dockerfile: Dockerfile
platform: linux/arm64
container_name: nocapwya-backend
ports:
- "8000:8000"
volumes:
- ./data:/data
depends_on:
db:
condition: service_healthy
env_file:
- .env
restart: unless-stopped
networks:
- wya-net
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
platform: linux/arm64
container_name: nocapwya-frontend
ports:
- "3000:80"
volumes:
- ./data/tiles:/usr/share/nginx/html/tiles:ro
depends_on:
- backend
env_file:
- .env
restart: unless-stopped
networks:
- wya-net
volumes:
pg_data:
networks:
wya-net:
driver: bridge
EOF
# Verify YAML syntax (should output nothing if valid)
docker compose config # Runs parser; if error, it'll show line details