docker-compose.yml 886 B

1234567891011121314151617181920212223242526272829303132333435
  1. # https://docs.docker.com/compose/compose-file/05-services/
  2. services:
  3. # https://hub.docker.com/_/golang
  4. go_kit:
  5. ports:
  6. - 0:80
  7. - 0:22
  8. image: golang:1.26.0
  9. command: sleep infinity
  10. working_dir: /workspace
  11. volumes:
  12. - .:/workspace
  13. - ~/.ssh:/root/.ssh
  14. - go:/go
  15. gk_mysql:
  16. ports:
  17. - 0:3306
  18. image: mysql:8.0.37
  19. restart: unless-stopped
  20. # NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
  21. # (this is just an example, not intended to be a production configuration)
  22. command: --default-authentication-plugin=mysql_native_password
  23. environment:
  24. MYSQL_ROOT_PASSWORD: root
  25. gk_redis:
  26. ports:
  27. - 0:6379
  28. # 默认密码为空
  29. image: redis:7.2.5
  30. volumes:
  31. go:
  32. external: true