docker-compose.yml 7.1 KB

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