mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-06 20:22:14 +00:00
Merge pull request #3643 from Dokploy/fix/add-migration-command-on-start
feat(migration): add migration entry point and update start script
This commit is contained in:
@@ -24,6 +24,7 @@ try {
|
|||||||
.build({
|
.build({
|
||||||
entryPoints: {
|
entryPoints: {
|
||||||
server: "server/server.ts",
|
server: "server/server.ts",
|
||||||
|
migration: "migration.ts",
|
||||||
"reset-password": "reset-password.ts",
|
"reset-password": "reset-password.ts",
|
||||||
"reset-2fa": "reset-2fa.ts",
|
"reset-2fa": "reset-2fa.ts",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build-server && npm run build-next",
|
"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-server": "tsx esbuild.config.ts",
|
||||||
"build-next": "next build --webpack",
|
"build-next": "next build --webpack",
|
||||||
"setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run",
|
"setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run",
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import {
|
|||||||
} from "@dokploy/server";
|
} from "@dokploy/server";
|
||||||
import { config } from "dotenv";
|
import { config } from "dotenv";
|
||||||
import next from "next";
|
import next from "next";
|
||||||
import { migration } from "@/server/db/migration";
|
|
||||||
import packageInfo from "../package.json";
|
import packageInfo from "../package.json";
|
||||||
import { setupDockerContainerLogsWebSocketServer } from "./wss/docker-container-logs";
|
import { setupDockerContainerLogsWebSocketServer } from "./wss/docker-container-logs";
|
||||||
import { setupDockerContainerTerminalWebSocketServer } from "./wss/docker-container-terminal";
|
import { setupDockerContainerTerminalWebSocketServer } from "./wss/docker-container-terminal";
|
||||||
@@ -60,7 +59,6 @@ void app.prepare().then(async () => {
|
|||||||
if (process.env.NODE_ENV === "production" && !IS_CLOUD) {
|
if (process.env.NODE_ENV === "production" && !IS_CLOUD) {
|
||||||
createDefaultMiddlewares();
|
createDefaultMiddlewares();
|
||||||
await initializeNetwork();
|
await initializeNetwork();
|
||||||
await migration();
|
|
||||||
await initCronJobs();
|
await initCronJobs();
|
||||||
await initSchedules();
|
await initSchedules();
|
||||||
await initCancelDeployments();
|
await initCancelDeployments();
|
||||||
@@ -68,10 +66,6 @@ void app.prepare().then(async () => {
|
|||||||
await sendDokployRestartNotifications();
|
await sendDokployRestartNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_CLOUD && process.env.NODE_ENV === "production") {
|
|
||||||
await migration();
|
|
||||||
}
|
|
||||||
|
|
||||||
server.listen(PORT, HOST);
|
server.listen(PORT, HOST);
|
||||||
console.log(`Server Started on: http://${HOST}:${PORT}`);
|
console.log(`Server Started on: http://${HOST}:${PORT}`);
|
||||||
await initEnterpriseBackupCronJobs();
|
await initEnterpriseBackupCronJobs();
|
||||||
|
|||||||
Reference in New Issue
Block a user