mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #603 from Dokploy/fix/start-schedules-and-server
fix(server): update build paths
This commit is contained in:
@@ -15,7 +15,6 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|||||||
# Deploy only the dokploy app
|
# Deploy only the dokploy app
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN pnpm --filter=@dokploy/server switch:prod
|
|
||||||
RUN pnpm --filter=@dokploy/server build
|
RUN pnpm --filter=@dokploy/server build
|
||||||
RUN pnpm --filter=./apps/dokploy run build
|
RUN pnpm --filter=./apps/dokploy run build
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=@dokploy/server
|
|||||||
ARG NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
|
ARG NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
|
||||||
ENV NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=$NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
|
ENV NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=$NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN pnpm --filter=@dokploy/server switch:prod
|
|
||||||
RUN pnpm --filter=@dokploy/server build
|
RUN pnpm --filter=@dokploy/server build
|
||||||
RUN pnpm --filter=./apps/dokploy run build
|
RUN pnpm --filter=./apps/dokploy run build
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=@dokploy/server
|
|||||||
# Deploy only the dokploy app
|
# Deploy only the dokploy app
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN pnpm --filter=@dokploy/server switch:prod
|
|
||||||
RUN pnpm --filter=@dokploy/server build
|
RUN pnpm --filter=@dokploy/server build
|
||||||
RUN pnpm --filter=./apps/schedules run build
|
RUN pnpm --filter=./apps/schedules run build
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=@dokploy/server
|
|||||||
# Deploy only the dokploy app
|
# Deploy only the dokploy app
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN pnpm --filter=@dokploy/server switch:prod
|
|
||||||
RUN pnpm --filter=@dokploy/server build
|
RUN pnpm --filter=@dokploy/server build
|
||||||
RUN pnpm --filter=./apps/api run build
|
RUN pnpm --filter=./apps/api run build
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
export interface LemonSqueezyLicenseResponse {
|
|
||||||
valid: boolean;
|
|
||||||
error?: string;
|
|
||||||
meta?: {
|
|
||||||
store_id: string;
|
|
||||||
order_id: number;
|
|
||||||
order_item_id: number;
|
|
||||||
product_id: number;
|
|
||||||
product_name: string;
|
|
||||||
variant_id: number;
|
|
||||||
variant_name: string;
|
|
||||||
customer_id: number;
|
|
||||||
customer_name: string;
|
|
||||||
customer_email: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,45 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
deployApplication,
|
|
||||||
deployCompose,
|
|
||||||
deployRemoteApplication,
|
deployRemoteApplication,
|
||||||
deployRemoteCompose,
|
deployRemoteCompose,
|
||||||
rebuildApplication,
|
|
||||||
rebuildCompose,
|
|
||||||
rebuildRemoteApplication,
|
rebuildRemoteApplication,
|
||||||
rebuildRemoteCompose,
|
rebuildRemoteCompose,
|
||||||
updateApplicationStatus,
|
updateApplicationStatus,
|
||||||
updateCompose,
|
updateCompose,
|
||||||
} from "@dokploy/server/dist";
|
} from "@dokploy/server";
|
||||||
import type { DeployJob } from "./schema";
|
import type { DeployJob } from "./schema";
|
||||||
import type { LemonSqueezyLicenseResponse } from "./types";
|
|
||||||
|
|
||||||
// const LEMON_SQUEEZY_API_KEY = process.env.LEMON_SQUEEZY_API_KEY;
|
|
||||||
// const LEMON_SQUEEZY_STORE_ID = process.env.LEMON_SQUEEZY_STORE_ID;
|
|
||||||
// export const validateLemonSqueezyLicense = async (
|
|
||||||
// licenseKey: string,
|
|
||||||
// ): Promise<LemonSqueezyLicenseResponse> => {
|
|
||||||
// try {
|
|
||||||
// const response = await fetch(
|
|
||||||
// "https://api.lemonsqueezy.com/v1/licenses/validate",
|
|
||||||
// {
|
|
||||||
// method: "POST",
|
|
||||||
// headers: {
|
|
||||||
// "Content-Type": "application/json",
|
|
||||||
// "x-api-key": LEMON_SQUEEZY_API_KEY as string,
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify({
|
|
||||||
// license_key: licenseKey,
|
|
||||||
// store_id: LEMON_SQUEEZY_STORE_ID as string,
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return response.json();
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error("Error validating license:", error);
|
|
||||||
// return { valid: false, error: "Error validating license" };
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
export const deploy = async (job: DeployJob) => {
|
export const deploy = async (job: DeployJob) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
runMongoBackup,
|
runMongoBackup,
|
||||||
runMySqlBackup,
|
runMySqlBackup,
|
||||||
runPostgresBackup,
|
runPostgresBackup,
|
||||||
} from "@dokploy/server/dist";
|
} from "@dokploy/server";
|
||||||
import { db } from "@dokploy/server/dist/db";
|
import { db } from "@dokploy/server/dist/db";
|
||||||
import { backups, server } from "@dokploy/server/dist/db/schema";
|
import { backups, server } from "@dokploy/server/dist/db/schema";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
||||||
"files": {
|
"files": {
|
||||||
"ignore": ["node_modules/**", ".next/**", "drizzle/**", ".docker", "dist"]
|
"ignore": [
|
||||||
|
"node_modules/**",
|
||||||
|
".next/**",
|
||||||
|
"drizzle/**",
|
||||||
|
".docker",
|
||||||
|
"dist",
|
||||||
|
"packages/server/package.json"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"organizeImports": {
|
"organizeImports": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
|
|||||||
@@ -1,103 +1,91 @@
|
|||||||
{
|
{
|
||||||
"name": "@dokploy/server",
|
"name": "@dokploy/server",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
"./db": {
|
"./db": {
|
||||||
"import": "./src/db/index.ts",
|
"import": "./src/db/index.ts",
|
||||||
"require": "./dist/db/index.cjs.js"
|
"require": "./dist/db/index.cjs.js"
|
||||||
},
|
},
|
||||||
"./setup/*": {
|
"./setup/*": {
|
||||||
"import": "./src/setup/*.ts",
|
"import": "./src/setup/*.ts",
|
||||||
"require": "./dist/setup/index.cjs.js"
|
"require": "./dist/setup/index.cjs.js"
|
||||||
},
|
},
|
||||||
"./constants": {
|
"./constants": {
|
||||||
"import": "./src/constants/index.ts",
|
"import": "./src/constants/index.ts",
|
||||||
"require": "./dist/constants.cjs.js"
|
"require": "./dist/constants.cjs.js"
|
||||||
},
|
}
|
||||||
"./dist": {
|
},
|
||||||
"import": "./dist/index.js",
|
"scripts": {
|
||||||
"require": "./dist/index.cjs.js"
|
"build": "npm run switch:prod && rm -rf ./dist && tsc --project tsconfig.server.json && tsc-alias -p tsconfig.server.json",
|
||||||
},
|
"build:types": "tsc --emitDeclarationOnly --experimenta-dts",
|
||||||
"./dist/db": {
|
"switch:dev": "node scripts/switchToSrc.js",
|
||||||
"import": "./dist/db/index.js",
|
"switch:prod": "node scripts/switchToDist.js",
|
||||||
"require": "./dist/db/*.cjs"
|
"dev": "rm -rf ./dist && pnpm esbuild && tsc --emitDeclarationOnly --outDir dist -p tsconfig.server.json",
|
||||||
},
|
"esbuild": "tsx ./esbuild.config.ts && tsc --project tsconfig.server.json --emitDeclarationOnly ",
|
||||||
"./dist/db/schema": {
|
"typecheck": "tsc --noEmit"
|
||||||
"import": "./dist/db/schema/index.js",
|
},
|
||||||
"require": "./dist/db/schema/*.cjs"
|
"dependencies": {
|
||||||
}
|
"rotating-file-stream": "3.2.3",
|
||||||
},
|
"@faker-js/faker": "^8.4.1",
|
||||||
"scripts": {
|
"@lucia-auth/adapter-drizzle": "1.0.7",
|
||||||
"build": "rm -rf ./dist && tsc --project tsconfig.server.json && tsc-alias -p tsconfig.server.json",
|
"@octokit/auth-app": "^6.0.4",
|
||||||
"build:types": "tsc --emitDeclarationOnly --experimenta-dts",
|
"@react-email/components": "^0.0.21",
|
||||||
"switch:dev": "node scripts/switchToSrc.js",
|
"@trpc/server": "^10.43.6",
|
||||||
"switch:prod": "node scripts/switchToDist.js",
|
"adm-zip": "^0.5.14",
|
||||||
"dev": "rm -rf ./dist && pnpm esbuild && tsc --emitDeclarationOnly --outDir dist -p tsconfig.server.json",
|
"bcrypt": "5.1.1",
|
||||||
"esbuild": "tsx ./esbuild.config.ts && tsc --project tsconfig.server.json --emitDeclarationOnly ",
|
"bl": "6.0.11",
|
||||||
"typecheck": "tsc --noEmit"
|
"boxen": "^7.1.1",
|
||||||
},
|
"date-fns": "3.6.0",
|
||||||
"dependencies": {
|
"dockerode": "4.0.2",
|
||||||
"rotating-file-stream": "3.2.3",
|
"dotenv": "16.4.5",
|
||||||
"@faker-js/faker": "^8.4.1",
|
"drizzle-orm": "^0.30.8",
|
||||||
"@lucia-auth/adapter-drizzle": "1.0.7",
|
"drizzle-zod": "0.5.1",
|
||||||
"@octokit/auth-app": "^6.0.4",
|
"hi-base32": "^0.5.1",
|
||||||
"@react-email/components": "^0.0.21",
|
"js-yaml": "4.1.0",
|
||||||
"@trpc/server": "^10.43.6",
|
"lodash": "4.17.21",
|
||||||
"adm-zip": "^0.5.14",
|
"lucia": "^3.0.1",
|
||||||
"bcrypt": "5.1.1",
|
"nanoid": "3",
|
||||||
"bl": "6.0.11",
|
"node-os-utils": "1.3.7",
|
||||||
"boxen": "^7.1.1",
|
"node-pty": "1.0.0",
|
||||||
"date-fns": "3.6.0",
|
"node-schedule": "2.1.1",
|
||||||
"dockerode": "4.0.2",
|
"nodemailer": "6.9.14",
|
||||||
"dotenv": "16.4.5",
|
"octokit": "3.1.2",
|
||||||
"drizzle-orm": "^0.30.8",
|
"otpauth": "^9.2.3",
|
||||||
"drizzle-zod": "0.5.1",
|
"postgres": "3.4.4",
|
||||||
"hi-base32": "^0.5.1",
|
"public-ip": "6.0.2",
|
||||||
"js-yaml": "4.1.0",
|
"qrcode": "^1.5.3",
|
||||||
"lodash": "4.17.21",
|
"react": "18.2.0",
|
||||||
"lucia": "^3.0.1",
|
"react-dom": "18.2.0",
|
||||||
"nanoid": "3",
|
"slugify": "^1.6.6",
|
||||||
"node-os-utils": "1.3.7",
|
"ws": "8.16.0",
|
||||||
"node-pty": "1.0.0",
|
"zod": "^3.23.4",
|
||||||
"node-schedule": "2.1.1",
|
"ssh2": "1.15.0"
|
||||||
"nodemailer": "6.9.14",
|
},
|
||||||
"octokit": "3.1.2",
|
"devDependencies": {
|
||||||
"otpauth": "^9.2.3",
|
"esbuild-plugin-alias": "0.2.1",
|
||||||
"postgres": "3.4.4",
|
"tailwindcss": "^3.4.1",
|
||||||
"public-ip": "6.0.2",
|
"tsx": "^4.7.1",
|
||||||
"qrcode": "^1.5.3",
|
"tsc-alias": "1.8.10",
|
||||||
"react": "18.2.0",
|
"@types/adm-zip": "^0.5.5",
|
||||||
"react-dom": "18.2.0",
|
"@types/bcrypt": "5.0.2",
|
||||||
"slugify": "^1.6.6",
|
"@types/dockerode": "3.3.23",
|
||||||
"ws": "8.16.0",
|
"@types/js-yaml": "4.0.9",
|
||||||
"zod": "^3.23.4",
|
"@types/lodash": "4.17.4",
|
||||||
"ssh2": "1.15.0"
|
"@types/node": "^18.17.0",
|
||||||
},
|
"@types/node-os-utils": "1.3.4",
|
||||||
"devDependencies": {
|
"@types/node-schedule": "2.1.6",
|
||||||
"esbuild-plugin-alias": "0.2.1",
|
"@types/nodemailer": "^6.4.15",
|
||||||
"tailwindcss": "^3.4.1",
|
"@types/qrcode": "^1.5.5",
|
||||||
"tsx": "^4.7.1",
|
"@types/react": "^18.2.37",
|
||||||
"tsc-alias": "1.8.10",
|
"@types/react-dom": "^18.2.15",
|
||||||
"@types/adm-zip": "^0.5.5",
|
"@types/ws": "8.5.10",
|
||||||
"@types/bcrypt": "5.0.2",
|
"drizzle-kit": "^0.21.1",
|
||||||
"@types/dockerode": "3.3.23",
|
"esbuild": "0.20.2",
|
||||||
"@types/js-yaml": "4.0.9",
|
"postcss": "^8.4.31",
|
||||||
"@types/lodash": "4.17.4",
|
"typescript": "^5.4.2",
|
||||||
"@types/node": "^18.17.0",
|
"@types/ssh2": "1.15.1"
|
||||||
"@types/node-os-utils": "1.3.4",
|
}
|
||||||
"@types/node-schedule": "2.1.6",
|
}
|
||||||
"@types/nodemailer": "^6.4.15",
|
|
||||||
"@types/qrcode": "^1.5.5",
|
|
||||||
"@types/react": "^18.2.37",
|
|
||||||
"@types/react-dom": "^18.2.15",
|
|
||||||
"@types/ws": "8.5.10",
|
|
||||||
"drizzle-kit": "^0.21.1",
|
|
||||||
"esbuild": "0.20.2",
|
|
||||||
"postcss": "^8.4.31",
|
|
||||||
"typescript": "^5.4.2",
|
|
||||||
"@types/ssh2": "1.15.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,8 @@ const __dirname = path.dirname(__filename);
|
|||||||
const packagePath = path.resolve(__dirname, "../package.json");
|
const packagePath = path.resolve(__dirname, "../package.json");
|
||||||
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
||||||
|
|
||||||
|
pkg.main = "./dist/index.js";
|
||||||
|
|
||||||
pkg.exports = {
|
pkg.exports = {
|
||||||
".": {
|
".": {
|
||||||
import: "./dist/index.js",
|
import: "./dist/index.js",
|
||||||
@@ -21,6 +23,18 @@ pkg.exports = {
|
|||||||
import: "./dist/*",
|
import: "./dist/*",
|
||||||
require: "./dist/*.cjs",
|
require: "./dist/*.cjs",
|
||||||
},
|
},
|
||||||
|
"./dist": {
|
||||||
|
import: "./dist/index.js",
|
||||||
|
require: "./dist/index.cjs.js",
|
||||||
|
},
|
||||||
|
"./dist/db": {
|
||||||
|
import: "./dist/db/index.js",
|
||||||
|
require: "./dist/db/index.cjs.js",
|
||||||
|
},
|
||||||
|
"./dist/db/schema": {
|
||||||
|
import: "./dist/db/schema/index.js",
|
||||||
|
require: "./dist/db/schema/index.cjs.js",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2));
|
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2));
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ const packagePath = path.resolve(__dirname, "../package.json");
|
|||||||
// Leer el archivo package.json
|
// Leer el archivo package.json
|
||||||
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
||||||
|
|
||||||
|
pkg.main = "./src/index.ts";
|
||||||
|
|
||||||
// Modificar los exports
|
// Modificar los exports
|
||||||
pkg.exports = {
|
pkg.exports = {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
@@ -25,19 +27,6 @@ pkg.exports = {
|
|||||||
import: "./src/constants/index.ts",
|
import: "./src/constants/index.ts",
|
||||||
require: "./dist/constants.cjs.js",
|
require: "./dist/constants.cjs.js",
|
||||||
},
|
},
|
||||||
"./dist": {
|
|
||||||
import: "./dist/index.js",
|
|
||||||
require: "./dist/index.cjs.js",
|
|
||||||
},
|
|
||||||
|
|
||||||
"./dist/db": {
|
|
||||||
import: "./dist/db/index.js",
|
|
||||||
require: "./dist/db/*.cjs",
|
|
||||||
},
|
|
||||||
"./dist/db/schema": {
|
|
||||||
import: "./dist/db/schema/index.js",
|
|
||||||
require: "./dist/db/schema/*.cjs",
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Guardar los cambios en package.json
|
// Guardar los cambios en package.json
|
||||||
|
|||||||
Reference in New Issue
Block a user