You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

docker-compose.yml 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. ---
  2. networks:
  3. default:
  4. name: ${PREFIX}
  5. services:
  6. adminer:
  7. container_name: ${PREFIX}-adminer
  8. dns:
  9. - 1.1.1.1
  10. hostname: ${PREFIX}-adminer
  11. image: adminer:4.8.1-standalone
  12. labels:
  13. - traefik.enable=true
  14. - traefik.http.routers.${PREFIX}-adminer.entrypoints=https
  15. - traefik.http.routers.${PREFIX}-adminer.rule=Host(`adminer.${APP_URL}`)
  16. - traefik.http.routers.${PREFIX}-adminer.tls=true
  17. - traefik.http.services.${PREFIX}-adminer.loadbalancer.server.port=8080
  18. app:
  19. container_name: ${PREFIX}-app
  20. dns:
  21. - 1.1.1.1
  22. environment:
  23. - PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE}
  24. - PHP_UPLOAD_MAX_FILESIZE=${PHP_UPLOAD_MAX_FILESIZE}
  25. - XDEBUG_CLIENT_HOST=${XDEBUG_CLIENT_HOST}
  26. - XDEBUG_MODE=${XDEBUG_MODE}
  27. hostname: ${PREFIX}-app
  28. image: ${APP_IMAGE_TAG}
  29. labels:
  30. - traefik.enable=true
  31. - traefik.http.routers.${PREFIX}-web.entrypoints=http
  32. - traefik.http.routers.${PREFIX}-web.middlewares=https-redirect@file
  33. - traefik.http.routers.${PREFIX}-web.rule=Host(`${APP_URL}`)
  34. - traefik.http.routers.${PREFIX}-webssl.entrypoints=https
  35. - traefik.http.routers.${PREFIX}-webssl.rule=Host(`${APP_URL}`)
  36. - traefik.http.routers.${PREFIX}-webssl.tls=true
  37. - traefik.http.services.${PREFIX}-webssl.loadbalancer.server.port=80
  38. volumes:
  39. - root:/root
  40. - webroot:/var/www/html
  41. - wp-cli-cache:/var/www/.wp-cli
  42. - cache:/var/www/.cache
  43. db:
  44. command: --default-authentication-plugin=mysql_native_password
  45. container_name: ${PREFIX}-db
  46. environment:
  47. MYSQL_DATABASE: ${DB_NAME}
  48. MYSQL_PASSWORD: ${DB_USER_PASSWORD}
  49. MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
  50. MYSQL_USER: ${DB_USER}
  51. hostname: ${PREFIX}-db
  52. image: mariadb:10.4.6-bionic
  53. ports:
  54. - "${TRAEFIK_LISTENING_IP}:3306:3306"
  55. volumes:
  56. - db:/var/lib/mysql
  57. traefik:
  58. container_name: ${PREFIX}-traefik
  59. command: ["--configFile=/etc/traefik/static/traefik.yml"]
  60. dns:
  61. - 1.1.1.1
  62. image: traefik:2.5.3
  63. labels:
  64. - traefik.enable=true
  65. - traefik.http.routers.${PREFIX}-traefik.entrypoints=https
  66. - traefik.http.routers.${PREFIX}-traefik.rule=Host(`traefik.${APP_URL}`)
  67. - traefik.http.routers.${PREFIX}-traefik.service=api@internal
  68. - traefik.http.routers.${PREFIX}-traefik.tls=true
  69. ports:
  70. - "${TRAEFIK_LISTENING_IP}:80:80"
  71. - "${TRAEFIK_LISTENING_IP}:443:443"
  72. volumes:
  73. - /etc/localtime:/etc/localtime:ro
  74. - /var/run/docker.sock:/var/run/docker.sock:ro
  75. - traefik-certs:/certs:ro
  76. - traefik-dynamic:/etc/traefik/dynamic:ro
  77. - traefik-logs:/logs
  78. - traefik-static:/etc/traefik/static:ro
  79. volumes:
  80. cache:
  81. external: true
  82. name: composer-cache
  83. db:
  84. external: true
  85. name: ${PREFIX}-db
  86. root:
  87. external: true
  88. name: ${PREFIX}-root
  89. traefik-certs:
  90. external: true
  91. name: ${PREFIX}-traefik-certs
  92. traefik-dynamic:
  93. external: true
  94. name: ${PREFIX}-traefik-dynamic
  95. traefik-logs:
  96. external: true
  97. name: ${PREFIX}-traefik-logs
  98. traefik-static:
  99. external: true
  100. name: ${PREFIX}-traefik-static
  101. webroot:
  102. external: true
  103. name: ${PREFIX}-webroot
  104. wp-cli-cache:
  105. external: true
  106. name: wp-cli-cache