gpt4 book ai didi

docker - Jira & Docker & Traefik 设置

转载 作者:行者123 更新时间:2023-12-02 18:36:50 26 4
gpt4 key购买 nike

我是第一次成为 Traefik 用户,我成功地使用 Traefik 和 Let's Encrypt Cert 为 Jira 配置了这个 docker compose 设置。

我的问题是 Jira 必须能够连接到他的自我。它们是一些 Jira 服务,例如小工具,它们通过 JavaScript 从他自己的地址通过 http 加载数据。这种类型的服务对我不起作用。他们是一个描述此问题的支持文档,并显示了此问题的解决方案。但我不知道如何使用 Traefik/Docker 正确设置它。 https://confluence.atlassian.com/jirakb/how-to-fix-gadget-titles-showing-as-__msg_gadget-813697086.html

你的帮助会很好。非常感谢!

version: '3'

services:

reverse-proxy:
image: traefik # The official Traefik docker image
command: --docker # Enables the web UI and tells Traefik to listen to docker --api
ports:
- "80:80" # The HTTP port
- "443:443" # The HTTPS port
- "8081:8080" # The Web UI (enabled by --api)
hostname: traefik
restart: unless-stopped
domainname: ${DOMAINNAME}
networks:
- frontend
- backend
labels:
- "traefik.enable=false"
- "traefik.frontend.rule=Host:traefik.${DOMAINNAME}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
- /etc/compose/traefik:/etc/traefik
- /etc/compose/shared:/shared

jira:
image: dchevell/jira-software:${JIRAVERSION}
ports:
- 8080:8080
networks:
- backend
restart: unless-stopped
volumes:
- /data/files/jira/data:/var/atlassian/application-data/jira
environment:
- JVM_MAXIMUM_MEMORY=2048m
- JVM_MINIMUM_MEMORY=768m
- CATALINA_CONNECTOR_PROXYNAME=jira.${DOMAINNAME}
- CATALINA_CONNECTOR_PROXYPORT=443
- CATALINA_CONNECTOR_SCHEME=https
- CATALINA_CONNECTOR_SECURE=true
depends_on:
- jira-postgresql
links:
- "jira-postgresql:database"
labels:
- "traefik.enable=true"
- "traefik.backend=jira"
- "traefik.frontend.rule=Host:jira.${DOMAINNAME}"
- "traefik.port=8080"

jira-postgresql:
image: postgres:9.6.11-alpine
networks:
- backend
ports:
- 5432:5432
restart: unless-stopped
volumes:
- /data/index/postgresql/data/:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=jira
- POSTGRES_USER=jira
- POSTGRES_DB=jira
labels:
- "traefik.enable=false"

# Portainer
portainer:
image: portainer/portainer
container_name: portainer
restart: always
ports:
- 9000:9000
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./etc-portainer/data:/data
environment:
TZ: ${TZ}
labels:
- "traefik.enable=false"

networks:
frontend:
external:
name: frontend
backend:
driver: bridge

最佳答案

配置我通过安全使用应用程序 - 不是 super 直观,但它看起来像是正确接受重定向安全流量。我在 godaddy 上使用 acme 来获取证书,并且它似乎在 https 上正常运行并强制接收:

强制重定向以供引用:

[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]

以及我为正确部署而制作的 dockerfile:
version: '3'

services:
jira:
image: dchevell/jira-software:8.1.0
deploy:
restart_policy:
condition: on-failure
labels:
- traefik.frontend.rule=Host:jira.mydomain.com
- traefik.enable=true
- traefik.port=8080
ports:
- "8080"
networks:
- traefik-pub
- jiranet
environment:
- CATALINA_CONNECTOR_PROXYNAME=jira.mydomain.com
- CATALINA_CONNECTOR_PROXYPORT=443
- CATALINA_CONNECTOR_SCHEME=https
- CATALINA_CONNECTOR_SECURE=true

jira-postgresql:
image: postgres:11.2-alpine
networks:
- jiranet
ports:
- "5432"
volumes:
- jira-postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=supersecret
- POSTGRES_USER=secret_user
- POSTGRES_DB=jira_db
labels:
- "traefik.enable=false"

volumes:
jira-postgres-data:

networks:
traefik-pub:
external: true
jiranet:
driver: overlay

这仍然需要手动配置数据库 - 有一天我可能会花时间构建我自己的 jira dockerfile,它已经接受了数据库配置,但是随着这个工作,我认为预配置数据库连接没有多大意义,当与重建我自己没有编写的 dockerfile 相比,这是 20 秒的额外工作。

关于docker - Jira & Docker & Traefik 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54692871/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com