--- services: spaces: build: ./web container_name: spaces ports: - "2025:2025" # Standard HTTP port for the web server volumes: - ./web:/var/www/html depends_on: - spaces_api spaces_api: build: ./api container_name: spaces_api restart: unless-stopped ports: - "7476:7476" volumes: - spaces_api_logs:/app/logs # Persistent volume for logs depends_on: spaces_db: condition: service_healthy environment: # Pass DB credentials to the Go API - VIPER_DBUSER=vintage - VIPER_DBPASS=changeme - VIPER_DBNAME=vintagecoding - VIPER_DBHOST=spaces_db spaces_api_tester: build: ./api container_name: spaces_api_tester depends_on: spaces_db: condition: service_healthy environment: - VIPER_DBUSER=vintage - VIPER_DBPASS=changeme - VIPER_DBNAME=vintagecoding_test - VIPER_DBHOST=spaces_db - VIPER_DBPORT=3306 command: ["go", "test", "-v"] spaces_db: image: docker.io/mariadb:latest container_name: spaces_db restart: unless-stopped healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] interval: 10s timeout: 5s retries: 3 volumes: - spaces_db_data:/var/lib/mysql environment: - MARIADB_ROOT_PASSWORD=QuaxlyQueen5012! - MARIADB_DATABASE=vintagecoding - MARIADB_USER=vintage - MARIADB_PASSWORD=changeme - MARIADB_EXTRA_DATABASES=vintagecoding_test ports: - "3306:3306" volumes: spaces_db_data: spaces_api_logs: