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

Create Dockerfile #601

Merged
merged 1 commit into from
Jul 12, 2021
Merged

Create Dockerfile #601

merged 1 commit into from
Jul 12, 2021

Conversation

cathaysia
Copy link
Contributor

添加了对 Docker 的支持。镜像的尺寸为 68.4MB 。其中:

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories

是国内构建镜像用到的,如果在 docker hub 上开启了自动构建的话就无需这个了。

平时我是配合 docker-compose 使用的,但是因为这个仓库貌似还没有官方镜像,所以没有提交 docker-compose.yml 。compose 文件内容如下:

version: "3.9"

services:
  whistle:
    build: .
    ports:
      - 8899:8899
    restart: unless-stopped
    environment:
      WHISTLE_PATH: "/whistle"
    volumes:
      - whistle_data:/whistle

volumes:
  whistle_data: {}

Create Docker Image for whistle
FROM alpine
COPY .npmrc /root/
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories&&apk add --no-cache nodejs npm && npm install whistle -g && apk del npm && mkdir /whistle
CMD w2 run -D /whistle
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w2 run 是调试模式,性能可能会差点,可以把启动命令改成:w2 run -M prod -D /whistle

@avwo avwo merged commit f4572a3 into avwo:master Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants