docker-compose.yml 688 B

12345678910111213141516171819202122
  1. version: '3.4'
  2. services:
  3. one-api:
  4. image: ghcr.io/songquanpeng/one-api:latest
  5. container_name: one-api
  6. restart: always
  7. command: --log-dir /app/logs
  8. ports:
  9. - "3000:3000"
  10. volumes:
  11. - /home/ubuntu/data/one-api:/data
  12. - /home/ubuntu/data/one-api/logs:/app/logs
  13. # environment:
  14. # REDIS_CONN_STRING: redis://default:redispw@localhost:49153
  15. # SESSION_SECRET: random_string
  16. # SQL_DSN: root:123456@tcp(localhost:3306)/one-api
  17. healthcheck:
  18. test: ["CMD-SHELL", "curl -s http://localhost:3000/api/status | grep -o '\"success\":\\s*true' | awk '{print $2}' | grep 'true'"]
  19. interval: 30s
  20. timeout: 10s
  21. retries: 3