version: '3'
services:
redis:
image: redis:3
container_name: redis
hostname: redis
command: redis-server /usr/local/etc/redis/redis.conf --requirepass yourpassword
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
node:
image: registry.cn-shenzhen.aliyuncs.com/yxw-docker/node8.9.3:latest
container_name: node
hostname: node
ports:
- "7001:7001"
working_dir: /source/lx-egg
links:
- redis:redis
volumes:
- /source:/source
# >在字符串中折叠换行,| 保留换行符,这两个符号是YAML中字符串经常使用的符号
# command:
# - /bin/sh
# - -c
# - |
# yarn install
# pm2-runtime start ecosystem.config.js
command: ["/bin/sh", "-c", "yarn install && yarn dev"]
网友评论