docker-compose.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # docker version: 18.06.0+
  2. # docker-compose version: 1.23.2+
  3. # OpenSSL version: OpenSSL 1.1.0h
  4. version: '3.7'
  5. services:
  6. web:
  7. image: alenx/walle-web:2.1
  8. container_name: walle-nginx
  9. hostname: nginx-web
  10. ports:
  11. # 如果宿主机80端口被占用,可自行修改为其他port(>=1024)
  12. # 0.0.0.0:要绑定的宿主机端口:docker容器内端口80
  13. - "80:80"
  14. depends_on:
  15. - python
  16. networks:
  17. - walle-net
  18. restart: always
  19. python:
  20. image: alenx/walle-python:2.1
  21. container_name: walle-python
  22. hostname: walle-python
  23. env_file:
  24. # walle.env需和docker-compose在同级目录
  25. - ./walle.env
  26. volumes:
  27. - /tmp/walle/codebase/:/tmp/walle/codebase/
  28. - /tmp/walle/logs/:/opt/walle-web/logs/
  29. - /root/.ssh:/root/.ssh/
  30. command: bash -c "cd /opt/walle_home/ && /bin/bash admin.sh migration && python waller.py"
  31. expose:
  32. - "5000"
  33. depends_on:
  34. - db
  35. networks:
  36. - walle-net
  37. restart: always
  38. db:
  39. image: mysql
  40. container_name: walle-mysql
  41. hostname: walle-mysql
  42. env_file:
  43. # walle.env需和docker-compose在同级目录
  44. - ./walle.env
  45. command: [ '--default-authentication-plugin=mysql_native_password', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
  46. ports:
  47. - "3306:3306"
  48. expose:
  49. - "3306"
  50. volumes:
  51. - /data/walle/mysql:/var/lib/mysql
  52. networks:
  53. - walle-net
  54. restart: always
  55. networks:
  56. walle-net:
  57. driver: bridge