docker-compose.yml.251027 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. version: '3.4'
  2. services:
  3. acta:
  4. image: lucasdiedrich/ojs:php7-test
  5. # ports:
  6. # - "4437:443"
  7. # restart: always
  8. environment:
  9. # - SERVERNAME="www.maastikuarhitektuur.ee"
  10. # - HTTPS="on"
  11. - OJS_DB_DRIVER=mysqli
  12. - OJS_CLI_INSTALL=0
  13. - OJS_DB_HOST=node # Database host
  14. - OJS_DB_USER=ojs_acta # Database username
  15. - OJS_DB_PASSWORD=R36aVTUKgOWgawMRvSVqZ4LfYWswZc # Database password
  16. - OJS_DB_NAME=ojs_acta # Database name
  17. volumes:
  18. # Create files or folders first and check permisions, to avoid errors:
  19. - private:/var/www/files
  20. - public:/var/www/html/public
  21. - logs:/var/log/apache2
  22. - backup:/srv/backups
  23. - data:/var/www/html
  24. - /etc/localtime:/etc/localtime
  25. networks:
  26. - db-network
  27. - traefik-network
  28. # - traefik-external
  29. depends_on:
  30. - node
  31. deploy:
  32. mode: replicated
  33. replicas: 1
  34. placement:
  35. constraints:
  36. - node.role == manager
  37. - node.hostname == hetzner
  38. labels:
  39. - "traefik.enable=true"
  40. - traefik.docker.network=traefik-network
  41. - traefik.constraint-label=traefik-network
  42. ## www.maastikuarhitektuur.ee
  43. ## http
  44. - traefik.http.routers.ojs-maastikuarhitektuur-http.rule=Host(`www.maastikuarhitektuur.ee`) || Host(`maastikuarhitektuur.ee`)
  45. - traefik.http.routers.ojs-maastikuarhitektuur-http.entrypoints=web
  46. ## http redirect to www
  47. - "traefik.http.routers.ojs-maastikuarhitektuur-http.middlewares=web-to-www-redirect"
  48. - "traefik.http.middlewares.web-to-www-redirect.redirectregex.regex=^http://(?:www.)?maastikuarhitektuur.ee/(.*)"
  49. - "traefik.http.middlewares.web-to-www-redirect.redirectregex.replacement=http://www.maastikuarhitektuur.ee/$${1}"
  50. ## http to https
  51. - traefik.http.routers.ojs-maastikuarhitektuur-http.middlewares=http-to-https
  52. ## https
  53. - traefik.http.routers.ojs-maastikuarhitektuur-https.rule=Host(`www.maastikuarhitektuur.ee`) || Host(`maastikuarhitektuur.ee`)
  54. - traefik.http.routers.ojs-maastikuarhitektuur-https.entrypoints=websecure
  55. - "traefik.http.routers.ojs-maastikuarhitektuur-https.tls.certresolver=mychallenge"
  56. ## https redirect to www
  57. - "traefik.http.routers.ojs-maastikuarhitektuur-https.middlewares=websecure-to-www-redirect"
  58. - "traefik.http.middlewares.websecure-to-www-redirect.redirectregex.regex=^https://(?:www.)?maastikuarhitektuur.ee/(.*)"
  59. - "traefik.http.middlewares.websecure-to-www-redirect.redirectregex.replacement=https://www.maastikuarhitektuur.ee/$${1}"
  60. ## service point
  61. - traefik.http.services.ojs-maastikuarhitektuur.loadbalancer.server.port=80
  62. - "traefik.http.routers.ojs-maastikuarhitektuur-http.service=ojs-maastikuarhitektuur"
  63. - "traefik.http.routers.ojs-maastikuarhitektuur-https.service=ojs-maastikuarhitektuur"
  64. configs:
  65. - source: supervisord_conf
  66. target: /etc/supervisord.conf
  67. # uid: '0'
  68. # gid: '0'
  69. # mode: 0440
  70. - source: config_inc_php
  71. target: /var/www/html/config.inc.php
  72. uid: '100'
  73. gid: '101'
  74. mode: 0440
  75. - source: custom_ini
  76. target: /usr/local/etc/php/conf.d/custom.ini
  77. - source: htaccess
  78. target: /var/www/html/.htaccess
  79. uid: '100'
  80. gid: '101'
  81. mode: 0644
  82. - source: ojs_conf
  83. target: /etc/apache2/conf.d/ojs.conf
  84. configs:
  85. supervisord_conf:
  86. file: ./config/supervisord.conf
  87. config_inc_php:
  88. file: ./config/ojs.config.inc
  89. custom_ini:
  90. file: ./config/php.custom.ini
  91. htaccess:
  92. file: ./config/htaccess
  93. ojs_conf:
  94. file: ./config/ojs.conf
  95. volumes:
  96. backup:
  97. # name: ojs_backup
  98. # driver: local
  99. logs:
  100. # name: ojs_logs
  101. # driver: local
  102. private:
  103. # name: ojs_private
  104. # driver: local
  105. public:
  106. # name: ojs_public
  107. # driver: local
  108. data:
  109. # name: ojs_data
  110. # driver: local
  111. networks:
  112. db-network:
  113. external: true
  114. traefik-network:
  115. external: true
  116. # traefik-external:
  117. # external:
  118. # name: traefik-external