Skip to content

Instantly share code, notes, and snippets.

@suncle1993
Created January 5, 2023 05:55
Show Gist options
  • Save suncle1993/2a4b3d6218e04718a27772b65bb38ace to your computer and use it in GitHub Desktop.
Save suncle1993/2a4b3d6218e04718a27772b65bb38ace to your computer and use it in GitHub Desktop.
docker-compose for local env
services:
db:
image: 'mysql:5.7'
container_name: mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
ports:
- '3306:3306'
volumes:
- './mysql/data:/var/lib/mysql'
- './mysql/init.sql:/docker-entrypoint-initdb.d/init.sql'
- './mysql/conf:/etc/mysql/conf.d'
command: [
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_general_ci'
]
restart: always
redis:
image: 'redis:latest'
container_name: redis
volumes:
- './redis/conf/redis.conf:/usr/local/etc/redis/redis.conf'
- './redis/data/:/data:rw'
ports:
- '6379:6379'
command:
- redis-server
- /usr/local/etc/redis/redis.conf
restart: always
es:
image: 'elasticsearch:7.17.2'
container_name: es
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- LANG=en_US.UTF-8
volumes:
- './es/data:/usr/share/elasticsearch/data'
- './es/plugins:/usr/share/elasticsearch/plugins'
ports:
- '9200:9200'
- '9300:9300'
restart: always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment