From 7ec3a86a882b9a9e3f4748e2287034bf3d4ef19a Mon Sep 17 00:00:00 2001 From: kev Date: Wed, 8 Feb 2023 17:14:09 +0800 Subject: [PATCH] update mastodon --- README.md | 2 +- mastodon/README.md | 2 +- mastodon/docker-compose.yml | 188 ++++++++++++------------------------ redis/docker-compose.yml | 2 +- 4 files changed, 64 insertions(+), 130 deletions(-) diff --git a/README.md b/README.md index e935d2a..3ce61dc 100644 --- a/README.md +++ b/README.md @@ -370,7 +370,7 @@ A collection of delicious docker recipes. - [x] heartexlabs/label-studio - [x] martialblog/limesurvey - [x] mailhog/mailhog -- [x] tootsuite/mastodon +- [x] linuxserver/mastodon - [x] matrixconduit/matrix-conduit - [x] getmeili/meilisearch :mag: - [x] mitmproxy/mitmproxy diff --git a/mastodon/README.md b/mastodon/README.md index bef01f4..fc731fa 100644 --- a/mastodon/README.md +++ b/mastodon/README.md @@ -4,4 +4,4 @@ mastodon [Mastodon][1] is a free, open-source social network server based on ActivityPub where users can follow friends and discover new ones. -[1]: https://github.com/tootsuite/mastodon +[1]: https://github.com/mastodon/mastodon diff --git a/mastodon/docker-compose.yml b/mastodon/docker-compose.yml index c534286..ad9e278 100644 --- a/mastodon/docker-compose.yml +++ b/mastodon/docker-compose.yml @@ -1,133 +1,67 @@ -version: '3' +version: "3.8" + services: - db: - restart: always - image: postgres:14-alpine - shm_size: 256mb - networks: - - internal_network - healthcheck: - test: ['CMD', 'pg_isready', '-U', 'postgres'] - volumes: - - ./postgres14:/var/lib/postgresql/data + + mastodon: + image: linuxserver/mastodon:latest environment: - - 'POSTGRES_HOST_AUTH_METHOD=trust' + - PUID=1000 + - PGID=1000 + - TZ=UTC + - LOCAL_DOMAIN=example.com + - REDIS_HOST=redis + - REDIS_PORT=6379 + - DB_HOST=postgres + - DB_USER=mastodon + - DB_NAME=mastodon + - DB_PASS=mastodon + - DB_PORT=5432 + - ES_ENABLED=false + - SECRET_KEY_BASE= + - OTP_SECRET= + - VAPID_PRIVATE_KEY= + - VAPID_PUBLIC_KEY= + - SMTP_SERVER=mail.example.com + - SMTP_PORT=25 + - SMTP_LOGIN= + - SMTP_PASSWORD= + - SMTP_FROM_ADDRESS=notifications@example.com + - S3_ENABLED=false + - WEB_DOMAIN=mastodon.example.com #optional + - ES_HOST=es #optional + - ES_PORT=9200 #optional + - ES_USER=elastic #optional + - ES_PASS=elastic #optional + - S3_BUCKET= #optional + - AWS_ACCESS_KEY_ID= #optional + - AWS_SECRET_ACCESS_KEY= #optional + - S3_ALIAS_HOST= #optional + - SIDEKIQ_ONLY=false #optional + - SIDEKIQ_QUEUE= #optional + - SIDEKIQ_DEFAULT=false #optional + - SIDEKIQ_THREADS=5 #optional + - DB_POOL=5 #optional + volumes: + - ./data/mastodon:/config + ports: + - "8080:80" + - "8443:443" + restart: unless-stopped + + postgres: + image: postgres:14-alpine + volumes: + - ./data/postgres:/var/lib/postgresql/data + environment: + # POSTGRES_HOST_AUTH_METHOD=trust + - POSTGRES_USER=mastodon + - POSTGRES_PASSWORD=mastodon + - POSTGRES_DB=mastodon + restart: unless-stopped redis: - restart: always image: redis:7-alpine - networks: - - internal_network - healthcheck: - test: ['CMD', 'redis-cli', 'ping'] + command: --save 900 1 volumes: - - ./redis:/data - - # es: - # restart: always - # image: docker.elastic.co/elasticsearch/elasticsearch:7.17.4 - # environment: - # - "ES_JAVA_OPTS=-Xms512m -Xmx512m -Des.enforce.bootstrap.checks=true" - # - "xpack.license.self_generated.type=basic" - # - "xpack.security.enabled=false" - # - "xpack.watcher.enabled=false" - # - "xpack.graph.enabled=false" - # - "xpack.ml.enabled=false" - # - "bootstrap.memory_lock=true" - # - "cluster.name=es-mastodon" - # - "discovery.type=single-node" - # - "thread_pool.write.queue_size=1000" - # networks: - # - external_network - # - internal_network - # healthcheck: - # test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"] - # volumes: - # - ./elasticsearch:/usr/share/elasticsearch/data - # ulimits: - # memlock: - # soft: -1 - # hard: -1 - # nofile: - # soft: 65536 - # hard: 65536 - # ports: - # - '127.0.0.1:9200:9200' - - web: - build: . - image: tootsuite/mastodon - restart: always - env_file: .env.production - command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000" - networks: - - external_network - - internal_network - healthcheck: - # prettier-ignore - test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1'] - ports: - - '127.0.0.1:3000:3000' - depends_on: - - db - - redis - # - es - volumes: - - ./public/system:/mastodon/public/system - - streaming: - build: . - image: tootsuite/mastodon - restart: always - env_file: .env.production - command: node ./streaming - networks: - - external_network - - internal_network - healthcheck: - # prettier-ignore - test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1'] - ports: - - '127.0.0.1:4000:4000' - depends_on: - - db - - redis - - sidekiq: - build: . - image: tootsuite/mastodon - restart: always - env_file: .env.production - command: bundle exec sidekiq - depends_on: - - db - - redis - networks: - - external_network - - internal_network - volumes: - - ./public/system:/mastodon/public/system - healthcheck: - test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] - - ## Uncomment to enable federation with tor instances along with adding the following ENV variables - ## http_proxy=http://privoxy:8118 - ## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true - # tor: - # image: sirboops/tor - # networks: - # - external_network - # - internal_network - # - # privoxy: - # image: sirboops/privoxy - # volumes: - # - ./priv-config:/opt/config - # networks: - # - external_network - # - internal_network - -networks: - external_network: - internal_network: - internal: true + - ./data/redis:/data + restart: unless-stopped diff --git a/redis/docker-compose.yml b/redis/docker-compose.yml index 919bb9f..b903c24 100644 --- a/redis/docker-compose.yml +++ b/redis/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.8" services: redis: - image: redis:6-alpine + image: redis:7-alpine command: --save 900 1 ports: - "6379:6379"