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 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. image: ${APP_IMAGE_TAG}
  28. labels:
  29. - traefik.enable=true
  30. - traefik.http.routers.${PREFIX}-web.entrypoints=http
  31. - traefik.http.routers.${PREFIX}-web.middlewares=https-redirect@file
  32. - traefik.http.routers.${PREFIX}-web.rule=Host(`${APP_URL}`)
  33. - traefik.http.routers.${PREFIX}-webssl.entrypoints=https
  34. - traefik.http.routers.${PREFIX}-webssl.rule=Host(`${APP_URL}`)
  35. - traefik.http.routers.${PREFIX}-webssl.tls=true
  36. - traefik.http.services.${PREFIX}-webssl.loadbalancer.server.port=80
  37. volumes:
  38. - webroot:/var/www/html
  39. - wp-cli-cache:/var/www/.wp-cli
  40. db:
  41. command: --default-authentication-plugin=mysql_native_password
  42. container_name: ${PREFIX}-db
  43. environment:
  44. MYSQL_DATABASE: ${DB_NAME}
  45. MYSQL_PASSWORD: ${DB_USER_PASSWORD}
  46. MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
  47. MYSQL_USER: ${DB_USER}
  48. hostname: ${PREFIX}-db
  49. image: mariadb:10.4.6-bionic
  50. ports:
  51. - "${TRAEFIK_LISTENING_IP}:3306:3306"
  52. volumes:
  53. - db:/var/lib/mysql
  54. traefik:
  55. container_name: ${PREFIX}-traefik
  56. command: ["--configFile=/etc/traefik/static/traefik.yml"]
  57. dns:
  58. - 1.1.1.1
  59. image: traefik:2.5.3
  60. labels:
  61. - traefik.enable=true
  62. - traefik.http.routers.${PREFIX}-traefik.entrypoints=https
  63. - traefik.http.routers.${PREFIX}-traefik.rule=Host(`traefik.${APP_URL}`)
  64. - traefik.http.routers.${PREFIX}-traefik.service=api@internal
  65. - traefik.http.routers.${PREFIX}-traefik.tls=true
  66. ports:
  67. - "${TRAEFIK_LISTENING_IP}:80:80"
  68. - "${TRAEFIK_LISTENING_IP}:443:443"
  69. volumes:
  70. - /etc/localtime:/etc/localtime:ro
  71. - /var/run/docker.sock:/var/run/docker.sock:ro
  72. - traefik-certs:/certs:ro
  73. - traefik-dynamic:/etc/traefik/dynamic:ro
  74. - traefik-logs:/logs
  75. - traefik-static:/etc/traefik/static:ro
  76. version: "3.4"
  77. volumes:
  78. db:
  79. name: ${PREFIX}-db
  80. traefik-certs:
  81. name: ${PREFIX}-traefik-certs
  82. traefik-dynamic:
  83. name: ${PREFIX}-traefik-dynamic
  84. traefik-logs:
  85. name: ${PREFIX}-traefik-logs
  86. traefik-static:
  87. name: ${PREFIX}-traefik-static
  88. webroot:
  89. name: ${PREFIX}-webroot
  90. wp-cli-cache:
  91. name: wp-cli-cache