Skip to content

Latest commit

 

History

History
100 lines (72 loc) · 1.88 KB

Docker.md

File metadata and controls

100 lines (72 loc) · 1.88 KB

Docker

Docker Automated build Docker Stars Docker pulls

Requirements

  • docker
  • docker-compose

Config

Compose

  • docker-compose.dev.yml
  • docker-compose.yml

Modify Github Id/Secret

version: '3'
services: 
  cnode:
    environment:
      - EGG_PASSPORT_GITHUB_CLIENT_ID=test
      - EGG_PASSPORT_GITHUB_CLIENT_SECRET=test

Modify Alinode AppId/Secret

version: '3'
services: 
  cnode:
    environment:
      - EGG_ALINODE_APPID=appid
      - EGG_ALINODE_SECRET=secret

to disable alinode, modify config/plugin.prod.js

Change Port

version: '3'
services: 
  cnode:
    ports:
      - ${PORT}:7001

Develop

Setup redis / mongodb / egg-cnode

# start
docker-compose -f docker-compose.dev.yml up

# stop
docker-compose -f docker-compose.dev.yml down

# remove volume/cache
docker-compose -f docker-compose.dev.yml down -v

Develop:

export EGG_REDIS_PASSWORD=egg_cnode
export EGG_MONGODB_URL=mongodb://egg_cnode:[email protected]:27017/egg_cnode
export EGG_PASSPORT_GITHUB_CLIENT_ID=${id}
export EGG_PASSPORT_GITHUB_CLIENT_SECRET=${secret}

npm i
npm run dev

Deploy

Modify docker-compose.yml

Run / Stop

# start
docker-compose up -d

# stop
docker-compose down

# remove volume/cache
docker-compose down -v