Pleroma + :whale: = :heart:
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.m4 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. changequote(`<', `>')
  2. define(<upcase>, <translit($1, <a-z>, <A-Z>)>)
  3. define(<env>, <upcase($1)=${upcase($1):?upcase($1)}>)
  4. define(<env_fb>, <upcase($1)=${upcase($1):-$2}>)
  5. define(<env_inline>, <${upcase($1):?upcase($1)}>)
  6. define(<env_inline_fb>, <${upcase($1):-$2}>)
  7. {
  8. "version": "3.7",
  9. ifdef(<__DOCKER_NETWORK>, <
  10. "networks": {
  11. "default": {
  12. "external": {
  13. "name": "__DOCKER_NETWORK"
  14. }
  15. }
  16. },
  17. >)
  18. "services": {
  19. ifelse(__SCRIPT_DEPLOY_POSTGRES, true, <
  20. "db": {
  21. "image": "postgres:10.3-alpine",
  22. "restart": "unless-stopped",
  23. "environment": [
  24. "env(<postgres_db>)",
  25. "env(<postgres_user>)",
  26. "env(<postgres_password>)"
  27. ],
  28. "volumes": [
  29. "env_inline(<docker_datadir>)/db:/var/lib/postgresql/data",
  30. "./initdb.sql:/docker-entrypoint-initdb.d/pleroma.sql"
  31. ]
  32. },
  33. >)
  34. ifdef(<__SCRIPT_USE_PROXY>, <
  35. ifelse(
  36. __SCRIPT_USE_PROXY, traefik, <>,
  37. __SCRIPT_USE_PROXY, manual, <>,
  38. __SCRIPT_USE_PROXY, nginx, <
  39. "proxy": {
  40. "image": "nginx:alpine",
  41. "ports": [
  42. "__SCRIPT_BIND_IP:__SCRIPT_PORT_HTTP:__SCRIPT_PORT_HTTP"ifdef(__SCRIPT_ENABLE_SSL, <,>)
  43. ifdef(__SCRIPT_ENABLE_SSL, <"__SCRIPT_BIND_IP:__SCRIPT_PORT_HTTPS:__SCRIPT_PORT_HTTPS">)
  44. ],
  45. "links": [
  46. "server:pleroma"
  47. ],
  48. "volumes": [
  49. "./custom.d/server.nginx:/etc/nginx/nginx.conf:ro",
  50. "./custom.d/vhost.nginx:/etc/nginx/conf.d/pleroma.conf:ro"ifdef(__SCRIPT_ENABLE_SSL, <,>)
  51. ifdef(__SCRIPT_ENABLE_SSL, <"./custom.d/ssl.crt:/ssl/ssl.crt:ro",>)
  52. ifdef(__SCRIPT_ENABLE_SSL, <"./custom.d/ssl.key:/ssl/ssl.key:ro">)
  53. ]
  54. },
  55. >, __SCRIPT_USE_PROXY, apache, <
  56. "proxy": {
  57. "image": "amd64/apache:alpine",
  58. "ports": [
  59. "__SCRIPT_BIND_IP:__SCRIPT_PORT_HTTP:__SCRIPT_PORT_HTTP"ifdef(__SCRIPT_ENABLE_SSL, <,>)
  60. ifdef(__SCRIPT_ENABLE_SSL, <"__SCRIPT_BIND_IP:__SCRIPT_PORT_HTTPS:__SCRIPT_PORT_HTTPS">)
  61. ],
  62. "links": [
  63. "server:pleroma"
  64. ],
  65. "volumes": [
  66. "./custom.d/server.httpd:/usr/local/apache2/conf/httpd.conf:ro",
  67. "./custom.d/vhost.httpd:/usr/local/apache2/conf/extra/httpd-vhosts.conf:ro"ifdef(__SCRIPT_ENABLE_SSL, <,>)
  68. ifdef(__SCRIPT_ENABLE_SSL, <"./custom.d/ssl.crt:/ssl/ssl.crt:ro",>)
  69. ifdef(__SCRIPT_ENABLE_SSL, <"./custom.d/ssl.key:/ssl/ssl.key:ro">)
  70. ]
  71. },
  72. >, <
  73. errprint(Invalid option __SCRIPT_USE_PROXY for <SCRIPT_USE_PROXY>)
  74. m4exit(<1>)
  75. >
  76. )
  77. >)
  78. "server": {
  79. "build": {
  80. "context": ".",
  81. "args": [
  82. "env(<pleroma_version>)",
  83. "env(<docker_uid>)",
  84. "env(<docker_gid>)",
  85. "env_fb(<pleroma_uploads_path>, </uploads>)"
  86. ]
  87. },
  88. "init": true,
  89. "restart": "unless-stopped",
  90. "links": [
  91. ifelse(__SCRIPT_DEPLOY_POSTGRES, true, <"db">)
  92. ],
  93. "environment": [
  94. "env_fb(<mix_env>, <prod>)"
  95. ],
  96. "volumes": [
  97. "./custom.d:/custom.d:ro",
  98. "./config.exs:/home/pleroma/pleroma/config/prod.secret.exs:ro",
  99. "env_inline(<docker_datadir>)/uploads:env_inline_fb(<pleroma_uploads_path>, </uploads>)"
  100. ],
  101. "labels": [
  102. ifelse(__SCRIPT_USE_PROXY, traefik, <
  103. "traefik.enable=true",
  104. "traefik.fe.port=4000",
  105. "traefik.fe.protocol=http",
  106. "traefik.fe.entryPoints=http,https",
  107. "traefik.fe.frontend.rule=Host:patsubst(__PLEROMA_URL, <string:>, <>)",
  108. "traefik.cache.port=4000",
  109. "traefik.cache.protocol=http",
  110. "traefik.cache.entryPoints=http,https",
  111. "traefik.cache.frontend.rule=Host:patsubst(patsubst(__PLEROMA_MEDIA_PROXY_URL, <http.*?//>, <>), <string:>, <>)"
  112. >)
  113. ]
  114. }
  115. }
  116. }