docker-compose.yml 605 B

1234567891011121314151617181920212223242526272829
  1. version: "2"
  2. services:
  3. mysql:
  4. image: mysql:8.0.13
  5. restart: always
  6. command: --default-authentication-plugin=mysql_native_password
  7. container_name: thinkcmf-db
  8. environment:
  9. - MYSQL_ROOT_PASSWORD=Root@123
  10. - MYSQL_USER=thinkcmf
  11. - MYSQL_PASSWORD=Thinkcmf@123
  12. - MYSQL_DATABASE=thinkcmf
  13. - TZ=Asia/Shanghai
  14. volumes:
  15. - ./mysql:/var/lib/mysql
  16. ports:
  17. - "3306:3306"
  18. - "80:80"
  19. expose:
  20. - 80
  21. thinkcmf:
  22. build: .
  23. network_mode: service:mysql
  24. restart: always
  25. container_name: thinkcmf-web
  26. depends_on:
  27. - mysql