mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-16 04:35:24 +02:00
feat(migration): add migration entry point and update start script
- Added a new entry point for migration in the esbuild configuration. - Updated the start script in package.json to run the migration before starting the server. - Removed the direct migration call from the server initialization process to streamline the workflow.
This commit is contained in:
@@ -24,6 +24,7 @@ try {
|
||||
.build({
|
||||
entryPoints: {
|
||||
server: "server/server.ts",
|
||||
migration: "migration.ts",
|
||||
"reset-password": "reset-password.ts",
|
||||
"reset-2fa": "reset-2fa.ts",
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "npm run build-server && npm run build-next",
|
||||
"start": "node -r dotenv/config dist/server.mjs",
|
||||
"start": "node -r dotenv/config dist/migration.mjs && node -r dotenv/config dist/server.mjs",
|
||||
"build-server": "tsx esbuild.config.ts",
|
||||
"build-next": "next build --webpack",
|
||||
"setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run",
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
} from "@dokploy/server";
|
||||
import { config } from "dotenv";
|
||||
import next from "next";
|
||||
import { migration } from "@/server/db/migration";
|
||||
import packageInfo from "../package.json";
|
||||
import { setupDockerContainerLogsWebSocketServer } from "./wss/docker-container-logs";
|
||||
import { setupDockerContainerTerminalWebSocketServer } from "./wss/docker-container-terminal";
|
||||
@@ -60,7 +59,6 @@ void app.prepare().then(async () => {
|
||||
if (process.env.NODE_ENV === "production" && !IS_CLOUD) {
|
||||
createDefaultMiddlewares();
|
||||
await initializeNetwork();
|
||||
await migration();
|
||||
await initCronJobs();
|
||||
await initSchedules();
|
||||
await initCancelDeployments();
|
||||
@@ -68,10 +66,6 @@ void app.prepare().then(async () => {
|
||||
await sendDokployRestartNotifications();
|
||||
}
|
||||
|
||||
if (IS_CLOUD && process.env.NODE_ENV === "production") {
|
||||
await migration();
|
||||
}
|
||||
|
||||
server.listen(PORT, HOST);
|
||||
console.log(`Server Started on: http://${HOST}:${PORT}`);
|
||||
await initEnterpriseBackupCronJobs();
|
||||
|
||||
Reference in New Issue
Block a user