1
【笔记】通过 Docker 部署 Mastodon
source link: https://loli.fj.cn/zh-CN/2024/01/02/%E9%80%9A%E8%BF%87Docker%E9%83%A8%E7%BD%B2Mastodon/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
通过 Docker 部署 Mastodon
git clone https://github.com/tootsuite/mastodon.git
cd mastodon
创建 docker-compose
cp .env.production.sample .env.production
docker-compose up
<password>
:postgres 密码
version: '3'
services:
mastodon-db:
image: postgres:9.6-alpine
shm_size: 256mb
environment:
POSTGRES_DB: mastodon
POSTGRES_USER: mastodon
POSTGRES_PASSWORD: <password>
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
volumes:
- ./postgres:/var/lib/postgresql/data
restart: unless-stopped
mastodon-redis:
image: redis:6.0-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
volumes:
- ./redis:/data
restart: unless-stopped
mastodon-web:
image: tootsuite/mastodon
env_file: .env.production
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
depends_on:
- mastodon-db
- mastodon-redis
healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:3000/health || exit 1"]
ports:
- "127.0.0.1:3000:3000"
volumes:
- ./public/system:/mastodon/public/system
restart: unless-stopped
mastodon-streaming:
image: tootsuite/mastodon
env_file: .env.production
command: node ./streaming
depends_on:
- mastodon-db
- mastodon-redis
healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1"]
ports:
- "127.0.0.1:4000:4000"
restart: unless-stopped
mastodon-sidekiq:
image: tootsuite/mastodon
env_file: .env.production
command: bundle exec sidekiq
depends_on:
- mastodon-db
- mastodon-redis
volumes:
- ./public/system:/mastodon/public/system
restart: unless-stopped
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK