diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2b4ae69 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM registry.cn-shanghai.aliyuncs.com/devcon/node:18 +ARG PACKAGE +ENV PACKAGE $PACKAGE +ADD . /app +WORKDIR /app +RUN mkdir /app/log +RUN cd /app && \ + chmod +x start.sh && \ + npm config set registry https://registry.npmmirror.com/ && \ + npm config set "@batiao:registry" https://maven.batiao8.com/repository/npm-releases/ && \ + npm install && \ + npm run build +EXPOSE 9270 +CMD [ "/app/start.sh" ] diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..af809b9 --- /dev/null +++ b/start.sh @@ -0,0 +1,4 @@ +cd /app +while [ true ];do + nohup npm run start +done