docker-compose.yml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. version: '3'
  2. networks:
  3. default:
  4. driver: overlay
  5. services:
  6. traefik:
  7. image: traefik:v2.2
  8. ports:
  9. - 80:80
  10. - 443:443
  11. deploy:
  12. replicas: 2 # https://youtu.be/btHpHjabRcc
  13. placement:
  14. constraints:
  15. - node.role == manager
  16. labels:
  17. - traefik.enable=true
  18. # Enable the dashboard UI
  19. - traefik.http.routers.api.rule=Host(`board.${DOMAIN}`)
  20. - traefik.http.routers.api.service=api@internal
  21. - traefik.http.routers.api.middlewares=auth
  22. - traefik.http.routers.api.tls=true
  23. - "traefik.http.middlewares.auth.basicauth.users=${TRAEFIK_API_USERS}"
  24. # Dummy service for Swarm port detection. The port can be any valid integer value.
  25. - traefik.http.services.dummy-svc.loadbalancer.server.port=9999
  26. - traefik.http.routers.traefik.tls=true
  27. # Use LS to get/renew certs for the TLD & subdomains
  28. - traefik.http.routers.traefik.tls.certresolver=le
  29. - traefik.http.routers.traefik.tls.domains[0].main=${DOMAIN}
  30. - traefik.http.routers.traefik.tls.domains[1].sans=*.${DOMAIN}
  31. volumes:
  32. - /var/run/docker.sock:/var/run/docker.sock:ro
  33. - ${CONTAINERS_DIR}/traefik:/certificates
  34. command:
  35. # Require a "traefik.enable=true" label
  36. - --providers.docker.exposedbydefault=false
  37. - --providers.docker.swarmmode=true
  38. # HTTP redirects to HTTPS
  39. - --entrypoints.web.address=:80
  40. - --entrypoints.web.http.redirections.entrypoint.permanent=false
  41. - --entrypoints.web.http.redirections.entryPoint.to=websecure
  42. - --entrypoints.web.http.redirections.entryPoint.scheme=https
  43. - --entrypoints.websecure.address=:443
  44. # Auto cert renewal via cloudflare
  45. - --certificatesresolvers.le.acme.email=${LETSENCRYPT_EMAIL}
  46. - --certificatesresolvers.le.acme.storage=/certificates/acme.json
  47. - --certificatesresolvers.le.acme.dnschallenge.provider=cloudflare
  48. - --accesslog=true
  49. - --log=true
  50. # Enable the traefik dashboard
  51. - --api=true
  52. - --providers.file.filename=/certificates/static.toml
  53. environment:
  54. - CLOUDFLARE_EMAIL=${CLOUDFLARE_EMAIL}
  55. - CLOUDFLARE_API_KEY=${CLOUDFLARE_API_KEY}
  56. jekyll:
  57. image: jibby0/docker-jekyll-webhook
  58. deploy:
  59. replicas: 2
  60. labels:
  61. - traefik.enable=true
  62. - traefik.http.routers.jekyll.tls=true
  63. - traefik.http.routers.jekyll.rule=Host(`${DOMAIN}`)
  64. - traefik.http.services.jekyll.loadbalancer.server.port=80
  65. environment:
  66. - TZ=America/New_York
  67. - WEBHOOK_SECRET=${WEBHOOK_SECRET}
  68. - REPO=https://github.com/jibby0/blog.git
  69. restart: always
  70. volumes:
  71. - ${CONTAINERS_DIR}/jekyll/vendor_cache:/vendor
  72. postgres:
  73. image: postgres:10.5
  74. volumes:
  75. - ${CONTAINERS_DIR}/postgres/data:/var/lib/postgresql/data
  76. - ${CONTAINERS_DIR}/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
  77. environment:
  78. - POSTGRES_USER=${POSTGRES_USER}
  79. - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
  80. restart: always
  81. nextcloud:
  82. image: nextcloud:20.0.4
  83. deploy:
  84. labels:
  85. - traefik.enable=true
  86. - traefik.http.routers.nextcloud.tls=true
  87. - traefik.http.routers.nextcloud.rule=Host(`nextcloud.${DOMAIN}`)
  88. - traefik.http.services.nextcloud.loadbalancer.server.port=80
  89. expose:
  90. - "80"
  91. links:
  92. - postgres
  93. volumes:
  94. - ${CONTAINERS_DIR}/nextcloud:/var/www/html
  95. restart: always
  96. gogs:
  97. image: gogs/gogs:0.12.0
  98. deploy:
  99. labels:
  100. - traefik.enable=true
  101. - traefik.http.routers.gogs.tls=true
  102. - traefik.http.routers.gogs.rule=Host(`gogs.${DOMAIN}`)
  103. - traefik.http.services.gogs.loadbalancer.server.port=3000
  104. expose:
  105. - "3000"
  106. volumes:
  107. - ${CONTAINERS_DIR}/gogs:/data
  108. # NOTE: My gogs instance isn't happy with postgres. For now, it's a small server
  109. # and sqlite is fine, but I should fix this eventually.
  110. #links:
  111. # - postgres
  112. restart: always
  113. matrix:
  114. image: matrixdotorg/synapse:v1.25.0
  115. deploy:
  116. labels:
  117. - traefik.enable=true
  118. - traefik.http.routers.matrix.tls=true
  119. - traefik.http.routers.matrix.rule=Host(`matrix.${DOMAIN}`)
  120. - traefik.http.services.matrix.loadbalancer.server.port=8008
  121. expose:
  122. - "8008"
  123. links:
  124. - postgres
  125. # NOTE: These don't directly configure anything anymore.
  126. # They can be used with `migrate_config` to build
  127. # homeserver.yaml
  128. # environment:
  129. # - SYNAPSE_SERVER_NAME=matrix.jibby.org
  130. # - SYNAPSE_REPORT_STATS=no
  131. # - SYNAPSE_NO_TLS=true
  132. # - SYNAPSE_ENABLE_REGISTRATION=no
  133. # - SYNAPSE_LOG_LEVEL=INFO
  134. # - SYNAPSE_REGISTRATION_SHARED_SECRET=${POSTGRES_PASSWORD}
  135. # - POSTGRES_DB=synapse
  136. # - POSTGRES_HOST=postgres
  137. # - POSTGRES_USER=synapse
  138. # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
  139. volumes:
  140. - ${CONTAINERS_DIR}/matrix:/data
  141. restart: always
  142. selfoss:
  143. image: hardware/selfoss
  144. deploy:
  145. labels:
  146. - traefik.enable=true
  147. - traefik.http.routers.selfoss.tls=true
  148. - traefik.http.routers.selfoss.rule=Host(`selfoss.${DOMAIN}`)
  149. - traefik.http.services.selfoss.loadbalancer.server.port=8888
  150. expose:
  151. - "8888"
  152. links:
  153. - postgres
  154. volumes:
  155. - ${CONTAINERS_DIR}/selfoss:/selfoss/data
  156. environment:
  157. - CRON_PERIOD=5m
  158. restart: always
  159. jellyfin:
  160. # 10.6.4 can't use Chromecasts properly: https://github.com/jellyfin/jellyfin/issues/3852
  161. # The "jellyfixer" service below fixes that for now. Assumes jellyfin's
  162. # baseURL is set to the default of `/jellyfin`
  163. image: jellyfin/jellyfin:10.6.4
  164. deploy:
  165. placement:
  166. constraints:
  167. - node.labels.media-encoding == true
  168. labels:
  169. - traefik.enable=true
  170. - traefik.http.routers.jellyfin.tls=true
  171. - traefik.http.routers.jellyfin.rule=Host(`jellyfin.${DOMAIN}`)
  172. - traefik.http.services.jellyfin.loadbalancer.server.port=8096
  173. expose:
  174. - "8096"
  175. volumes:
  176. - ${CONTAINERS_DIR}/jellyfin:/config
  177. - ${MEDIA_DIR}:/media
  178. #- /dev/shm/jellyfin-transcodes:/transcodes
  179. #- /dev/shm/jellyfin-cache:/cache
  180. restart: always
  181. jellyfixer:
  182. image: quay.io/xsteadfastx/jellyfixer:latest
  183. deploy:
  184. labels:
  185. - traefik.enable=true
  186. - traefik.http.routers.jellyfixer-secured.tls=true
  187. - traefik.http.routers.jellyfixer-secured.rule=Host(`jellyfin.${DOMAIN}`) && Path(`/jellyfin/System/Info/Public`)
  188. - traefik.http.services.jellyfixer-secured.loadbalancer.server.port=8088
  189. command: http://jellyfin:8096/jellyfin
  190. environment:
  191. - JELLYFIXER_INTERNAL_URL=http://jellyfin:8096/jellyfin
  192. - JELLYFIXER_EXTERNAL_URL=https://jellyfin.${DOMAIN}/jellyfin
  193. # An example of a static HTTP file hosting site
  194. #camera:
  195. # image: nginx
  196. # deploy:
  197. # labels:
  198. # - traefik.enable=true
  199. # - traefik.http.routers.camera.tls=true
  200. # - traefik.http.routers.camera.rule=Host(`camera.${DOMAIN}`)
  201. # - traefik.http.services.camera.loadbalancer.server.port=80
  202. # volumes:
  203. # - ${MEDIA_DIR}/Camera:/home/app:ro
  204. # - ./conf.d/static.conf:/etc/nginx/sites-enabled/default
  205. # - ./conf.d/static.conf:/etc/nginx/conf.d/default.conf
  206. # restart: always