90 lines
3.0 KiB
YAML
90 lines
3.0 KiB
YAML
# Mattermore — Local Mattermost testing rig
|
|
# Start: docker compose up -d
|
|
# Stop: docker compose down
|
|
# URL: http://localhost:8065
|
|
# Reset: docker compose down -v (wipes DB + config)
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: mattermore-db
|
|
environment:
|
|
POSTGRES_DB: mattermost_test
|
|
POSTGRES_USER: mmuser
|
|
POSTGRES_PASSWORD: mmuser_pass
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U mmuser -d mattermost_test"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
mattermost:
|
|
image: mattermost/mattermost-team-edition:11.6.1
|
|
container_name: mattermore-server
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
# Database — full connection string (env format: MM_{SECTION}_{KEY})
|
|
MM_SQLSETTINGS_DATASOURCE: "postgres://mmuser:mmuser_pass@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10"
|
|
# Plugin + file storage — use /tmp to avoid permission issues
|
|
MM_PLUGINSETTINGS_DIRECTORY: /tmp/plugins
|
|
MM_FILESETTINGS_DIRECTORY: /tmp/file_data
|
|
# Server
|
|
MM_SERVICESETTINGS_SITEURL: http://localhost:8065
|
|
MM_SERVICESETTINGS_LISTENADDRESS: :8065
|
|
MM_SERVICESETTINGS_ENABLEDEVELOPER: "true"
|
|
MM_SERVICESETTINGS_ENABLEBOTACCOUNTCREATION: "true"
|
|
MM_SERVICESETTINGS_ENABLEUSERACCESSTOKENS: "true"
|
|
MM_SERVICESETTINGS_ENABLEAPI: "true"
|
|
MM_SERVICESETTINGS_ENABLECUSTOMGROUPS: "true"
|
|
MM_PLUGINSETTINGS_ENABLEUPLOADS: "true"
|
|
MM_PLUGINSETTINGS_ENABLE: "true"
|
|
MM_PLUGINSETTINGS_AUTOMATICPRECACHEDPLUGINS: "false"
|
|
MM_LOGSETTINGS_ENABLECONSOLE: "true"
|
|
MM_LOGSETTINGS_CONSOLELEVEL: "DEBUG"
|
|
MM_ANNOUNCEMENTSETTINGS_ADMINNOTICESENABLED: "false"
|
|
ports:
|
|
- "8065:8065"
|
|
volumes:
|
|
# Plugin directory — mount so you can upload via UI:
|
|
- ./mattermost/plugins:/mattermost/data/plugins:rw
|
|
# Data volume for uploads, avatars, etc.
|
|
- mattermost-data:/mattermost/data:rw
|
|
healthcheck:
|
|
test: ["CMD", "pgrep", "mattermost"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 30
|
|
start_period: 20s
|
|
|
|
setup:
|
|
image: curlimages/curl:latest
|
|
container_name: mattermore-setup
|
|
depends_on:
|
|
mattermost:
|
|
condition: service_healthy
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
echo "setup: waiting for Mattermost API..."
|
|
for i in $(seq 1 30); do
|
|
if curl -sf http://mattermost:8065/api/v4/system/ping > /dev/null 2>&1; then
|
|
echo "setup: Mattermost is ready"
|
|
break
|
|
fi
|
|
echo "setup: waiting... ($i)"
|
|
sleep 3
|
|
done
|
|
echo "setup: creating admin user..."
|
|
curl -s -X POST http://mattermost:8065/api/v4/users \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"email":"admin@example.com","username":"admin","password":"password"}' \
|
|
-w "\nsetup: HTTP %{http_code}"
|
|
echo ""
|
|
echo "setup: done"
|
|
|
|
volumes:
|
|
mattermost-data:
|