部署Dockerfile

This commit is contained in:
tangxinyue 2026-07-24 14:44:57 +08:00
parent 55cd86a45f
commit 9a1405743b
2 changed files with 18 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -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" ]

4
start.sh Normal file
View File

@ -0,0 +1,4 @@
cd /app
while [ true ];do
nohup npm run start
done