0

我正在尝试mattermost通过Caddy. 最接近的来自 micheljung答案

Web 和应用程序的配置方式没有意义。现在它起作用了。我做了什么:

启用 Let's Encrypt 和端口 80 到 443 转发
让应用程序公开端口 80 和 443(在 Dockerfile 和 docker-compose.yml 中配置)
删除 Web 容器,因为它的唯一目的基本上是 SSL,现在由 Mattermost
Profit 处理!

我确实跟着他的回答。但无法使用websocket功能这是我尝试过的

Caddyfile

chat.{$DOMAIN_NAME} {
    proxy / app:8000
}

Dockerfile

FROM abiosoft/caddy:0.11.2

COPY Caddyfile /etc/Caddyfile

docker-compose.yml

version: "2"

services:

  db:
    build: db
    read_only: true
    restart: unless-stopped
    volumes:
      - ./volumes/db/var/lib/postgresql/data:/var/lib/postgresql/data
      - /etc/localtime:/etc/localtime:ro
    environment:
      - POSTGRES_USER=mmuser
      - POSTGRES_PASSWORD=mmuser_password
      - POSTGRES_DB=mattermost

  app:
    build:
      context: app
      args:
        - edition=team
    restart: unless-stopped
    volumes:
      - ./volumes/app/mattermost/config:/mattermost/config:rw
      - ./volumes/app/mattermost/data:/mattermost/data:rw
      - ./volumes/app/mattermost/logs:/mattermost/logs:rw
      - ./volumes/app/mattermost/plugins:/mattermost/plugins:rw
      - ./volumes/app/mattermost/client-plugins:/mattermost/client/plugins:rw
      - /etc/localtime:/etc/localtime:ro
    expose:
      - 8000
    environment:
      # set same as db credentials and dbname
      - MM_USERNAME=mmuser
      - MM_PASSWORD=mmuser_password
      - MM_DBNAME=mattermost

  caddy:
    build:
      context: .
      dockerfile: Dockerfile
    depends_on:
      - app
    volumes:
      - production_caddy:/root/.caddy
    environment:
      - DOMAIN_NAME=unicornonzen.com
    ports:
      - "0.0.0.0:80:80"
      - "0.0.0.0:443:443"

volumes:
  production_caddy: {}

如何正确配置Caddymattermost在一起?

4

1 回答 1

0

读完pichouk。我在这里得到了答案

chat.{$DOMAIN_NAME} {
    proxy / app:8000 {
    websocket
    transparent
    }
}
于 2019-02-09T18:31:53.227 回答