Deploy Matter AI in your own infrastructure using Docker Compose
git clone https://github.com/GravityCloudAI/docker-compose.git
version: '3.8' services: matter-backend: image: gravitycloud/matter-enterprise:latest container_name: matter-backend restart: always ports: - "8080:8080" environment: - EMAIL_DOMAIN=b.com - POSTGRES_HOST=localhost - POSTGRES_PORT=5432 - POSTGRES_DB=postgres - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres depends_on: - postgres networks: - matter-network extra_hosts: - "host.docker.internal:host-gateway" - "localhost:host-gateway" deploy: resources: limits: cpus: '0.5' memory: 512M reservations: cpus: '0.25' memory: 256M matter-frontend: image: gravitycloud/matter-frontend:latest container_name: matter-frontend restart: always ports: - "80:3000" volumes: - ./config/nginx.conf:/etc/nginx/conf.d/default.conf depends_on: - matter-backend networks: - matter-network deploy: resources: limits: cpus: '0.5' memory: 512M reservations: cpus: '0.25' memory: 256M postgres: image: postgres:latest container_name: postgres-matter restart: always ports: - "5432:5432" environment: - POSTGRES_DB=postgres - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres volumes: - postgres-data:/var/lib/postgresql/data networks: - matter-network deploy: resources: limits: cpus: '0.5' memory: 512M reservations: cpus: '0.25' memory: 256M networks: matter-network: driver: bridge volumes: postgres-data:
server { listen 3000; server_name localhost; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri/ /index.html; } location /config/config.js { add_header Content-Type application/javascript; add_header Cache-Control no-cache; return 200 'window.MATTER_CONFIG = { BACKEND_URL: "/api" };'; } location /api { rewrite ^/api/(.*) /$1 break; proxy_pass http://matter-backend:8080; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass_request_headers on; proxy_method $request_method; proxy_pass_request_body on; proxy_set_header X-Original-URI $request_uri; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_body $request_body; proxy_buffering off; } error_page 404 /index.html; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; }
docker compose up -d
http://your-domain.com
http://your-domain.com/api
# Pull the latest images docker-compose pull # Restart the services with the new images docker-compose up -d
# Backup docker-compose exec postgres pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > matter_ai_backup_$(date +%Y%m%d).sql # Restore cat your_backup_file.sql | docker-compose exec -T postgres psql -U ${POSTGRES_USER} ${POSTGRES_DB}
docker-compose logs postgres
.env
docker-compose logs api