最重要的凭据在哪里设置?

时间:2019-09-25 14:26:46

标签: docker docker-compose dockerfile mattermost

最重要的凭证集在哪里?

如何找不到此信息?说真的,我觉得自己是个白痴,但是我被困在登录页面中……它要求我输入登录名/密码。

这是我的 docker-compose 配置:

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
  app:
    build:
      context: app
      #args:
       #- edition=team
       #- PUID=1000
       #- PGID=1000
    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
    environment:
      # set same as db credentials and dbname
      - MM_USERNAME=mmuser
      - MM_PASSWORD=mmuser_password
      - MM_DBNAME=mattermost
      # in case your config is not in default location
      #- MM_CONFIG=/mattermost/config/config.json

  web:
    build: web
    ports:
      - "8080:80"
      - "8443:443"
    read_only: true
    restart: unless-stopped
    volumes:
      # This directory must have cert files if you want to enable SSL
      - ./volumes/web/cert:/cert:ro
      - /etc/localtime:/etc/localtime:ro
    # Uncomment for SSL
    # environment:
    #  - MATTERMOST_ENABLE_SSL=true

我尝试使用 mmuser mmuser_password 作为最后的手段,但是没有用。

1 个答案:

答案 0 :(得分:1)

好,所以您不必自己创建用户...
我的数据库运行不正常,这阻止了应用程序将我重定向到注册页面(而是将我重定向到登录页面!)。

以下docker-compose对我有用。希望它可以帮助其他人:

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
    # uncomment the following to enable backup
    #  - AWS_ACCESS_KEY_ID=XXXX
    #  - AWS_SECRET_ACCESS_KEY=XXXX
    #  - WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
    #  - AWS_REGION=us-east-1

  app:
    build:
      context: app
      # uncomment following lines for team edition or change UID/GID
      # args:
      #   - edition=team
      #   - PUID=1000
      #   - PGID=1000
    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
    environment:
      # set same as db credentials and dbname
      - MM_USERNAME=mmuser
      - MM_PASSWORD=mmuser_password
      - MM_DBNAME=mattermost
      # in case your config is not in default location
      #- MM_CONFIG=/mattermost/config/config.json

  web:
    build: web
    ports:
      - "8080:80"
      - "8443:443"
    read_only: true
    restart: unless-stopped
    #volumes:
      # This directory must have cert files if you want to enable SSL
      #- ./volumes/web/cert:/cert:ro
      #- /etc/localtime:/etc/localtime:ro
    # Uncomment for SSL
    # environment:
    #  - MATTERMOST_ENABLE_SSL=true