hts/apps/blogai/Dockerfile

37 lines
765 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM node:20-bullseye-slim
ARG BLOGAI_HOST=ai.szaiai.com
ENV NODE_ENV=production
ENV BLOGAI_HOST=${BLOGAI_HOST}
ENV PORT=3008
# 安装工具pnpm + 调试常用工具
RUN apt-get update && \
apt-get install -y curl vim bash supervisor && \
npm install -g pnpm && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 拷贝依赖锁文件和配置
COPY pnpm-lock.yaml ./
COPY pnpm-workspace.yaml ./
COPY package.json ./
# 拷贝所有源码
COPY . ./
# 拷贝并处理 .env
COPY apps/blogai/.env.example apps/blogai/.env
RUN sed -i "s|{{BLOGAI_HOST}}|${BLOGAI_HOST}|g" apps/blogai/.env
# 安装依赖
RUN pnpm install
# 默认进入 blogai 目录
WORKDIR /app/apps/blogai
# 默认进 bash手动调试构建
CMD ["/bin/bash"]