美文网首页
docker 中 利用 docker-compose 搭建 no

docker 中 利用 docker-compose 搭建 no

作者: 精灵GG | 来源:发表于2018-11-01 17:11 被阅读0次
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"]

相关文章

网友评论

      本文标题:docker 中 利用 docker-compose 搭建 no

      本文链接:https://www.haomeiwen.com/subject/mpixxqtx.html