docker 中 利用 docker-compose 搭建 no

2018-11-01  本文已影响0人  精灵GG
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"]

上一篇 下一篇

猜你喜欢

热点阅读