Spaces:
Running
Running
File size: 633 Bytes
8a61573 314bb78 8a61573 314bb78 8a61573 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# 使用 Node.js 镜像构建和运行应用
FROM node:lts-slim
# 安装 git 和 ca-certificates
RUN apt-get update && \
apt-get install -y --no-install-recommends git ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 设置工作目录并克隆项目
WORKDIR /app
ARG REPO_URL=https://github.com/HChaoHui/msOauth2api.git
ARG BRANCH=vps
RUN git clone -b ${BRANCH} ${REPO_URL} .
COPY .env /app/
COPY apiRouters.js /app/routes/
# 安装 Yarn 依赖
RUN yarn install --frozen-lockfile
# 暴露端口(根据 .env 文件,默认 9898)
EXPOSE 9898
# 启动 Node.js 应用
CMD ["node", "app.js"] |