diff --git a/mastodon/docker-compose.ae3.yml b/mastodon/docker-compose.ae3.yml index 252a9c4..fa31a9c 100644 --- a/mastodon/docker-compose.ae3.yml +++ b/mastodon/docker-compose.ae3.yml @@ -1,91 +1,91 @@ -# version: '3' -# services: -# db: -# restart: unless-stopped -# image: postgres:14-alpine -# shm_size: 256mb -# networks: -# - default -# healthcheck: -# test: ['CMD', 'pg_isready', '-U', 'postgres'] -# volumes: -# - /srv/mastodon/postgres14:/var/lib/postgresql/data -# environment: -# - 'POSTGRES_HOST_AUTH_METHOD=trust' +version: '3' +services: + db: + restart: unless-stopped + image: postgres:14-alpine + shm_size: 256mb + networks: + - default + healthcheck: + test: ['CMD', 'pg_isready', '-U', 'postgres'] + volumes: + - /srv/mastodon/postgres14:/var/lib/postgresql/data + environment: + - 'POSTGRES_HOST_AUTH_METHOD=trust' -# redis: -# restart: unless-stopped -# image: redis:7-alpine -# networks: -# - default -# healthcheck: -# test: ['CMD', 'redis-cli', 'ping'] -# volumes: -# - /srv/mastodon/redis:/data + redis: + restart: unless-stopped + image: redis:7-alpine + networks: + - default + healthcheck: + test: ['CMD', 'redis-cli', 'ping'] + volumes: + - /srv/mastodon/redis:/data -# web: -# image: tootsuite/mastodon -# restart: unless-stopped -# env_file: .env.production -# command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000" -# networks: -# - traefik -# - default -# healthcheck: -# test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1'] -# depends_on: -# - db -# - redis -# volumes: -# - /srv/mastodon/public/system:/mastodon/public/system -# labels: -# - "traefik.enable=true" -# - "traefik.http.routers.mastodon.entrypoints=https" -# - "traefik.http.routers.mastodon.rule=(Host(`kvist.knast.cc`))" -# - "traefik.http.routers.mastodon.tls=true" -# - "traefik.http.routers.mastodon.tls.certresolver=http" -# - "traefik.http.routers.mastodon.service=mastodon" -# - "traefik.http.services.mastodon.loadbalancer.server.port=3000" -# - "traefik.docker.network=traefik" + web: + image: tootsuite/mastodon + restart: unless-stopped + env_file: .env.production + command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000" + networks: + - traefik + - default + healthcheck: + test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1'] + depends_on: + - db + - redis + volumes: + - /srv/mastodon/public/system:/mastodon/public/system + labels: + - "traefik.enable=true" + - "traefik.http.routers.mastodon.entrypoints=https" + - "traefik.http.routers.mastodon.rule=(Host(`kvist.knast.cc`))" + - "traefik.http.routers.mastodon.tls=true" + - "traefik.http.routers.mastodon.tls.certresolver=http" + - "traefik.http.routers.mastodon.service=mastodon" + - "traefik.http.services.mastodon.loadbalancer.server.port=3000" + - "traefik.docker.network=traefik" -# streaming: -# image: tootsuite/mastodon -# restart: unless-stopped -# env_file: .env.production -# command: node ./streaming/index.js -# networks: -# - default -# - traefik -# healthcheck: -# test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1'] -# depends_on: -# - db -# - redis -# labels: -# - "traefik.enable=true" -# - "traefik.http.routers.mastodon-api.entrypoints=https" -# - "traefik.http.routers.mastodon-api.rule=(Host(`kvist.knast.cc`) && PathPrefix(`/api/v1/streaming`))" -# - "traefik.http.routers.mastodon-api.tls=true" -# - "traefik.http.routers.mastodon-api.tls.certresolver=http" -# - "traefik.http.routers.mastodon-api.service=mastodon-api" -# - "traefik.http.services.mastodon-api.loadbalancer.server.port=4000" -# - "traefik.docker.network=traefik" + streaming: + image: tootsuite/mastodon + restart: unless-stopped + env_file: .env.production + command: node ./streaming/index.js + networks: + - default + - traefik + healthcheck: + test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1'] + depends_on: + - db + - redis + labels: + - "traefik.enable=true" + - "traefik.http.routers.mastodon-api.entrypoints=https" + - "traefik.http.routers.mastodon-api.rule=(Host(`kvist.knast.cc`) && PathPrefix(`/api/v1/streaming`))" + - "traefik.http.routers.mastodon-api.tls=true" + - "traefik.http.routers.mastodon-api.tls.certresolver=http" + - "traefik.http.routers.mastodon-api.service=mastodon-api" + - "traefik.http.services.mastodon-api.loadbalancer.server.port=4000" + - "traefik.docker.network=traefik" -# sidekiq: -# image: tootsuite/mastodon -# restart: unless-stopped -# env_file: .env.production -# command: bundle exec sidekiq -# depends_on: -# - db -# - redis -# networks: -# - default -# volumes: -# - /srv/mastodon/public/system:/mastodon/public/system -# healthcheck: -# test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] + sidekiq: + image: tootsuite/mastodon + restart: unless-stopped + env_file: .env.production + command: bundle exec sidekiq + depends_on: + - db + - redis + networks: + - default + volumes: + - /srv/mastodon/public/system:/mastodon/public/system + healthcheck: + test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] -# networks: -# traefik: -# external: true \ No newline at end of file +networks: + traefik: + external: true \ No newline at end of file diff --git a/mastodon/docker-compose.traefik.yml b/mastodon/docker-compose.traefik.yml index 9f4483f..1a3ed69 100644 --- a/mastodon/docker-compose.traefik.yml +++ b/mastodon/docker-compose.traefik.yml @@ -1,99 +1,99 @@ -# version: "3" -# services: -# db: -# restart: unless-stopped -# image: postgres:14-alpine -# shm_size: 256mb -# networks: -# - default -# healthcheck: -# test: ["CMD", "pg_isready", "-U", "postgres"] -# volumes: -# - ./postgres14:/var/lib/postgresql/data -# environment: -# - "POSTGRES_HOST_AUTH_METHOD=trust" +version: "3" +services: + db: + restart: unless-stopped + image: postgres:14-alpine + shm_size: 256mb + networks: + - default + healthcheck: + test: ["CMD", "pg_isready", "-U", "postgres"] + volumes: + - ./postgres14:/var/lib/postgresql/data + environment: + - "POSTGRES_HOST_AUTH_METHOD=trust" -# redis: -# restart: unless-stopped -# image: redis:7-alpine -# networks: -# - default -# healthcheck: -# test: ["CMD", "redis-cli", "ping"] -# volumes: -# - /srv/mastodon/redis:/data + redis: + restart: unless-stopped + image: redis:7-alpine + networks: + - default + healthcheck: + test: ["CMD", "redis-cli", "ping"] + volumes: + - /srv/mastodon/redis:/data -# web: -# image: ghcr.io/mastodon/mastodon:v4.3.3 -# restart: unless-stopped -# env_file: .env.production -# command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000" -# networks: -# - traefik -# - default -# healthcheck: -# test: -# [ -# "CMD-SHELL", -# "wget -q --spider --proxy=off localhost:3000/health || exit 1", -# ] -# depends_on: -# - db -# - redis -# volumes: -# - /srv/mastodon/web/mastodon/public/system -# labels: -# - "traefik.enable=true" -# - "traefik.http.routers.mastodon.entrypoints=https" -# - "traefik.http.routers.mastodon.rule=(Host(`kvist.knast.cc`))" -# - "traefik.http.routers.mastodon.tls=true" -# - "traefik.http.routers.mastodon.tls.certresolver=http" -# - "traefik.http.routers.mastodon.service=mastodon" -# - "traefik.http.services.mastodon.loadbalancer.server.port=3000" -# - "traefik.docker.network=proxy" + web: + image: ghcr.io/mastodon/mastodon:v4.3.3 + restart: unless-stopped + env_file: .env.production + command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000" + networks: + - traefik + - default + healthcheck: + test: + [ + "CMD-SHELL", + "wget -q --spider --proxy=off localhost:3000/health || exit 1", + ] + depends_on: + - db + - redis + volumes: + - /srv/mastodon/web/mastodon/public/system + labels: + - "traefik.enable=true" + - "traefik.http.routers.mastodon.entrypoints=https" + - "traefik.http.routers.mastodon.rule=(Host(`kvist.knast.cc`))" + - "traefik.http.routers.mastodon.tls=true" + - "traefik.http.routers.mastodon.tls.certresolver=http" + - "traefik.http.routers.mastodon.service=mastodon" + - "traefik.http.services.mastodon.loadbalancer.server.port=3000" + - "traefik.docker.network=proxy" -# streaming: -# image: ghcr.io/mastodon/mastodon-streaming:v4.3.3 -# restart: unless-stopped -# env_file: .env.production -# command: node ./streaming/index.js -# networks: -# - default -# - traefik -# healthcheck: -# test: -# [ -# "CMD-SHELL", -# "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1", -# ] -# depends_on: -# - db -# - redis -# labels: -# - "traefik.enable=true" -# - "traefik.http.routers.mastodon-api.entrypoints=https" -# - "traefik.http.routers.mastodon-api.rule=(Host(`kvist.knast.cc`) && PathPrefix(`/api/v1/streaming`))" -# - "traefik.http.routers.mastodon-api.tls=true" -# - "traefik.http.routers.mastodon-api.tls.certresolver=http" -# - "traefik.http.routers.mastodon-api.service=mastodon-api" -# - "traefik.http.services.mastodon-api.loadbalancer.server.port=4000" -# - "traefik.docker.network=proxy" + streaming: + image: ghcr.io/mastodon/mastodon-streaming:v4.3.3 + restart: unless-stopped + env_file: .env.production + command: node ./streaming/index.js + networks: + - default + - traefik + healthcheck: + test: + [ + "CMD-SHELL", + "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1", + ] + depends_on: + - db + - redis + labels: + - "traefik.enable=true" + - "traefik.http.routers.mastodon-api.entrypoints=https" + - "traefik.http.routers.mastodon-api.rule=(Host(`kvist.knast.cc`) && PathPrefix(`/api/v1/streaming`))" + - "traefik.http.routers.mastodon-api.tls=true" + - "traefik.http.routers.mastodon-api.tls.certresolver=http" + - "traefik.http.routers.mastodon-api.service=mastodon-api" + - "traefik.http.services.mastodon-api.loadbalancer.server.port=4000" + - "traefik.docker.network=proxy" -# sidekiq: -# image: tootsuite/mastodon -# restart: unless-stopped -# env_file: .env.production -# command: bundle exec sidekiq -# depends_on: -# - db -# - redis -# networks: -# - default -# volumes: -# - /srv/mastodon/sidekiq:/mastodon/public/system -# healthcheck: -# test: ["CMD-SHELL", "ps aux | grep '[s]idekiq\ 6' || false"] + sidekiq: + image: tootsuite/mastodon + restart: unless-stopped + env_file: .env.production + command: bundle exec sidekiq + depends_on: + - db + - redis + networks: + - default + volumes: + - /srv/mastodon/sidekiq:/mastodon/public/system + healthcheck: + test: ["CMD-SHELL", "ps aux | grep '[s]idekiq\ 6' || false"] -# networks: -# traefik: -# external: true +networks: + traefik: + external: true