Created
July 8, 2025 11:48
-
-
Save johnroyer/fd854889ec2b8451bb4120142d007b58 to your computer and use it in GitHub Desktop.
安裝 OpenSearch (single-node)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
app: | |
image: opensearchproject/opensearch:3.1.0 | |
ports: | |
- '9200:9200' | |
- '9600:9600' | |
environment: | |
- 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=secret' | |
- 'discovery.type=single-node' | |
- 'OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m' | |
- 'bootstrap.memory_lock=true' | |
healthcheck: | |
test: ["CMD-SHELL", "curl -k -u admin:secret --silent --fail https://localhost:9200/_cluster/health || exit 1"] | |
volumes: | |
- ./data/open-search:/usr/share/opensearch/data | |
- ./data/log:/usr/share/opensearch/logs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- ./pgqsldump:/backup | |
environment: | |
- 'POSTGRES_HOST_AUTH_METHOD=trust' | |
redis: | |
restart: always | |
image: redis:7-alpine | |
networks: | |
- internal_network | |
healthcheck: | |
test: ['CMD', 'redis-cli', 'ping'] | |
volumes: | |
- ./redis:/data | |
# 需要手動設定,請參考 Mastodon 官方說明文件 | |
# @see:https://docs.joinmastodon.org/admin/elasticsearch/ | |
opensearch: | |
image: opensearchproject/opensearch:3.1.0 | |
ports: | |
- '9200:9200' | |
- '9600:9600' | |
environment: | |
- 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=secret' | |
- 'discovery.type=single-node' | |
- 'OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m' | |
- 'bootstrap.memory_lock=true' | |
- 'DISABLE_SECURITY_PLUGIN=true' | |
volumes: | |
- ./opensearch/data:/usr/share/opensearch/data | |
- ./opensearch/log:/usr/share/opensearch/logs | |
healthcheck: | |
test: ["CMD-SHELL", "curl -k -u admin:9ADcXVZW4b8JwxWYCvLC --silent --fail https://localhost:9200/_cluster/health || exit 1"] | |
networks: | |
- external_network | |
- internal_network | |
web: | |
image: ghcr.io/mastodon/mastodon:v4.3.9 | |
restart: always | |
env_file: .env.production | |
command: bundle exec puma -C config/puma.rb | |
networks: | |
- external_network | |
- internal_network | |
healthcheck: | |
# prettier-ignore | |
test: ['CMD-SHELL',"curl -s --noproxy localhost localhost:3000/health | grep -q 'OK' || exit 1"] | |
ports: | |
- '127.0.0.1:3000:3000' | |
depends_on: | |
- db | |
- redis | |
#- es | |
volumes: | |
- ./public/system:/mastodon/public/system | |
streaming: | |
image: ghcr.io/mastodon/mastodon-streaming:v4.3.9 | |
restart: always | |
env_file: .env.production | |
command: node ./streaming/index.js | |
networks: | |
- external_network | |
- internal_network | |
healthcheck: | |
# prettier-ignore | |
test: ['CMD-SHELL', "curl -s --noproxy localhost localhost:4000/api/v1/streaming/health | grep -q 'OK' || exit 1"] | |
ports: | |
- '127.0.0.1:4000:4000' | |
depends_on: | |
- db | |
- redis | |
sidekiq: | |
build: . | |
image: ghcr.io/mastodon/mastodon:v4.3.9 | |
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"] | |
networks: | |
external_network: | |
internal_network: | |
internal: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment