Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可不可以写一篇关于docker部署eggjs的教程 #3977

Closed
Lancer-D opened this issue Oct 15, 2019 · 4 comments
Closed

可不可以写一篇关于docker部署eggjs的教程 #3977

Lancer-D opened this issue Oct 15, 2019 · 4 comments
Assignees

Comments

@Lancer-D
Copy link

No description provided.

@shyser
Copy link

shyser commented Oct 15, 2019

我的实践:
启动参数为

"scripts": {
    "start": "egg-scripts start --workers=1 --title=egg-server-some-server"
}

docker-compose.yml大概是这样:

version: '3'
services:

  some-server:
    image: node:10.16.0
    ports:
      - "7001"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - .:/usr/src/app
    working_dir: /usr/src/app
    command: sh -c "npm run tsc && npm start"
    # 或者
    # command: npm start
    logging:
      driver: json-file
      options:
        max-file: '3'
        max-size: 10m
    restart: always

主要就是不要后台启动就行了,其他没啥了,标准的Node服务。

@thonatos
Copy link
Member

#1431

可以参考这个,docker 部署相对简单,但涉及一些基础知识,需要自行补充。

@alickmail
Copy link

這是我使用 eggjs + typescript + docker 的教學,有問題可以隨時問我喔 =]

Dockerize a Typescript App in 15 mins:
https://itnext.io/dockerize-a-typescript-app-in-15-mins-a0e8c1e904b3

@canbaoSama
Copy link

ts项目我添加了
"tsc": "tsc",
"start": "npm run tsc && egg-scripts start --title=egg-server-service"
这样docker容器会报错识别不到tsc,请问有大佬知道怎么解决吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants