Skip to content

Commit a7305eb

Browse files
committed
fix: dokploy deploy
feat: 更新 Dockerfile 和 tsconfig.json,优化构建流程并指定输出目录 feat: 使用 Bun 作为基础镜像,优化 Dockerfile 以提高构建效率 feat: 更新 Dockerfile 和 package.json,优化构建流程并统一使用 Bun 命令 feat: 优化 Dockerfile 和 package.json,简化构建流程并修正启动脚本 feat: 更新 Dockerfile,升级 Bun 版本并优化依赖安装流程 feat: 更新 bun.lock,添加 TypeScript 依赖并升级至 5.3.0 fix: 修正 Dockerfile 中的文件复制路径错误 fix: 修正 package.json 中的启动脚本文件名错误 fix: 更新 Dockerfile 中的启动命令以使用正确的 Prisma 数据库推送命令 fix: 移除 Dockerfile 中 bun install 命令的 --production 标志以确保开发依赖被安装 fix: 更新 Dockerfile,添加 Prisma 客户端生成命令并修正启动命令 fix: 修正 Dockerfile 中生成 Prisma 客户端的命令 fix: 调整 Dockerfile 中 Prisma 客户端生成命令的位置 fix: 更新 Dockerfile 中的启动命令以确保 Prisma 客户端生成
1 parent f263ab8 commit a7305eb

6 files changed

Lines changed: 10 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ frontend/build
1111
frontend/public/sitemap.xml
1212
backend/scripts/compressed
1313
backend/scripts/uploads
14+
backend/dist
1415
.idea
1516
.vscode

backend/.npmrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

backend/Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
# Use a smaller base image
22
FROM node:22.15.0-alpine
33

4+
45
# Install OpenSSL
56
RUN apk add --no-cache openssl
67

78
# Set working directory
89
WORKDIR /app
910

10-
# Copy package files and npm config first for better caching
11-
COPY package*.json .npmrc ./
11+
# Copy project files
12+
COPY . .
1213

13-
# Install dependencies
1414
RUN npm install --omit=dev
1515

16-
# Copy rest of the project files
17-
COPY . .
18-
1916
# Expose container port 3000
2017
EXPOSE 3000
2118

2219
# Install dependencies, compile Prisma client and start app on container launch
23-
CMD ["sh", "-c", "npx prisma db push && npm start"]
20+
CMD ["sh", "-c", "npx prisma db push && npm start"]

backend/bun.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "node | mongodb | prisma",
55
"main": "server.ts",
6-
"scripts": {
6+
"scripts": {
77
"start": "npx ts-node server.ts ",
88
"dev": "nodemon server.ts",
99
"dev-f": "nodemon server.ts --ignore-errors",
@@ -55,6 +55,7 @@
5555
"nodemon": "^3.0.1",
5656
"prettier": "^3.5.3",
5757
"prisma": "^6.10.0",
58-
"ts-node": "^10.9.2"
58+
"ts-node": "^10.9.2",
59+
"typescript": "^5.3.0"
5960
}
6061
}

backend/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
5757
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
5858
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
59-
// "outDir": "./", /* Specify an output folder for all emitted files. */
59+
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
6060
// "removeComments": true, /* Disable emitting comments. */
6161
// "noEmit": true, /* Disable emitting files from a compilation. */
6262
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */

0 commit comments

Comments
 (0)