diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml new file mode 100644 index 0000000..e2fc7ba --- /dev/null +++ b/.gitea/workflows/docker-build.yml @@ -0,0 +1,16 @@ +name: Docker Build and Push + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..29cfccf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# 使用官方Node.js 18镜像作为基础 +FROM node:18-alpine + +# 设置工作目录 +WORKDIR /app + +# 复制package.json和package-lock.json +COPY package*.json ./ + +# 安装依赖 +RUN npm install + +# 复制项目文件 +COPY . . + +# 构建项目 +RUN npm run build + +# 暴露3000端口 +EXPOSE 3000 + +# 启动生产服务器 +CMD ["npm", "start"] \ No newline at end of file diff --git a/readme b/readme index bc1f03b..e6f6c30 100644 --- a/readme +++ b/readme @@ -2,4 +2,4 @@ 用于收集和整理经济数据,但是以经济理论的形式重新组织。 - 首页主要是放经济文章 - 数据主要是放各种经济数据和图表。 -- 策略是放按照经济理论组织的相关数据和图表的对比。 \ No newline at end of file +- 策略是放按照经济理论组织的相关数据和图表的对比。