Run
volumes:
db:
data_es:
services:
db:
image: postgres:14.3
shm_size: 512m
command: # full form
- "postgres"
- "-c"
- "max_connections=1000"
- "-c"
- "shared_buffers=256MB"
volumes:
- db:/var/lib/postgresql/data
- ./postgres/init:/docker-entrypoint-initdb.d
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASS=postgres
- PGUSER=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "su - postgres -c 'pg_isready -h db -U postgres'" ]
interval: 3s
timeout: 10s
retries: 5
redis:
image: redis:4.0.11-alpine3.8
ports:
- "6379:6379"
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 10s
retries: 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:9.4.2
command: >
bash -c "
bin/elasticsearch-plugin install analysis-phonetic --batch --silent 2>/dev/null || true &&
exec /usr/local/bin/docker-entrypoint.sh eswrapper
"
environment:
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- "xpack.security.enabled=false"
- "xpack.security.http.ssl.enabled=false"
- "discovery.type=single-node"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data_es:/usr/share/elasticsearch/data
ports:
- "9200:9200"
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1" ]
interval: 10s
timeout: 10s
retries: 3