version: '3.4' services: redis: image: redis:latest container_name: redis restart: always ports: - "6379:6379" deploy: resources: limits: cpus: "0.50" memory: 256M reservations: cpus: "0.10" memory: 64M postgres: image: postgres:15 container_name: postgres restart: always environment: POSTGRES_USER: ${POSTGRES_USER:-root} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?请在 .env 中设置 POSTGRES_PASSWORD,可参考 .env.example} POSTGRES_DB: ${POSTGRES_DB:-token-factory} volumes: - ./postgres_data:/var/lib/postgresql/data ports: - "5432:5432" deploy: resources: limits: cpus: "1.00" memory: 1G reservations: cpus: "0.25" memory: 256M