Docker Compose for Rust Actix Web

A Rust HTTP server using Actix Web. Blazing fast and memory-safe.

rust actix api backend
compose.yaml
services:
  api:
    build: .
    ports:
      - target: 8080
        mode: ingress
    environment:
      - RUST_LOG=info
      - HOST=0.0.0.0
      - PORT=8080
    healthcheck:
      test:
        - CMD
        - curl
        - -f
        - http://localhost:8080/
      interval: 30s
      timeout: 5s
      retries: 3
    deploy:
      resources:
        reservations:
          cpus: "0.25"
          memory: 64M
    restart: unless-stopped

Services

  • api .

Deploy

$ npx defang@latest compose up

Learn more about Defang