diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index dd7db3e..e2973af 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -2,16 +2,18 @@ version: '3' services: postgresql: + restart: always image: postgres:14-alpine env_file: env.production - restart: always - shm_size: 256mb + shm_size: 256mb + networks: + - internal_network healthcheck: test: ['CMD', 'pg_isready', '-U', 'postgres'] volumes: - postgresql:/var/lib/postgresql/data - networks: - - internal_network + environment: + - 'POSTGRES_HOST_AUTH_METHOD=trust' # pgbouncer: # image: edoburu/pgbouncer:1.12.0 @@ -24,14 +26,14 @@ services: # - internal_network redis: - image: redis:7-alpine restart: always + image: redis:7-alpine + networks: + - internal_network healthcheck: test: ['CMD', 'redis-cli', 'ping'] volumes: - redis:/data - networks: - - internal_network redis-volatile: image: redis:7-alpine @@ -63,26 +65,30 @@ services: - internal_network {% endif %} website: - image: tootsuite/mastodon:latest + build: . + restart: always + #image: tootsuite/mastodon:latest + image: ghcr.io/mastodon/mastodon env_file: - env.production - command: bash -c "bundle exec rails s -p 3000" - restart: always + #command: bash -c "bundle exec rails s -p 3000" + command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000" + networks: + - external_network + - internal_network + healthcheck: + test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1'] + ports: + - '127.0.0.1:3000:3000' depends_on: - postgresql # - pgbouncer - redis - redis-volatile - elasticsearch - ports: - - '127.0.0.1:3000:3000' - networks: - - internal_network - - external_network - healthcheck: - test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1'] volumes: - - uploads:/mastodon/public/system + #- uploads:/mastodon/public/system + - ./public/system:/mastodon/public/system shell: image: tootsuite/mastodon:latest @@ -97,7 +103,9 @@ services: - uploads:/mastodon/public/system streaming: - image: tootsuite/mastodon:latest + build: . + image: ghcr.io/mastodon/mastodon + #image: tootsuite/mastodon:latest env_file: - env.production command: node ./streaming @@ -117,7 +125,9 @@ services: test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1'] sidekiq: - image: tootsuite/mastodon:latest + build: . + image: ghcr.io/mastodon/mastodon + #image: tootsuite/mastodon:latest env_file: - env.production command: bundle exec sidekiq @@ -134,7 +144,8 @@ services: healthcheck: test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] volumes: - - uploads:/mastodon/public/system + #- uploads:/mastodon/public/system + - ./public/system:/mastodon/public/system networks: external_network: