mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge branch 'canary' into nginx-static-spa-build
This commit is contained in:
@@ -7,7 +7,7 @@ FROM base AS build
|
|||||||
COPY . /usr/src/app
|
COPY . /usr/src/app
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y python3 make g++ git python3-pip pkg-config libsecret-1-dev && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y python3 make g++ git python3-pip pkg-config libsecret-1-dev git-lfs && git lfs install && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
FROM node:18-slim AS base
|
|
||||||
ENV PNPM_HOME="/pnpm"
|
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
|
||||||
RUN corepack enable
|
|
||||||
|
|
||||||
FROM base AS build
|
|
||||||
COPY . /usr/src/app
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y python3 make g++ git git-lfs && git lfs install && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
# Build only the dokploy app
|
|
||||||
RUN pnpm run dokploy:build
|
|
||||||
|
|
||||||
# Deploy only the dokploy app
|
|
||||||
RUN pnpm deploy --filter=dokploy --prod /prod/dokploy
|
|
||||||
|
|
||||||
FROM base AS dokploy
|
|
||||||
COPY --from=build /prod/dokploy /prod/dokploy
|
|
||||||
WORKDIR /prod/dokploy
|
|
||||||
EXPOSE 3000
|
|
||||||
CMD [ "pnpm", "start" ]
|
|
||||||
@@ -36,6 +36,8 @@
|
|||||||
"test": "vitest --config __test__/vitest.config.ts"
|
"test": "vitest --config __test__/vitest.config.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"pino": "9.4.0",
|
||||||
|
"pino-pretty": "11.2.2",
|
||||||
"@ai-sdk/anthropic": "^1.0.6",
|
"@ai-sdk/anthropic": "^1.0.6",
|
||||||
"@ai-sdk/azure": "^1.0.15",
|
"@ai-sdk/azure": "^1.0.15",
|
||||||
"@ai-sdk/cohere": "^1.0.6",
|
"@ai-sdk/cohere": "^1.0.6",
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"pino": "9.4.0",
|
||||||
|
"pino-pretty": "11.2.2",
|
||||||
"micromatch": "4.0.8",
|
"micromatch": "4.0.8",
|
||||||
"@ai-sdk/anthropic": "^1.0.6",
|
"@ai-sdk/anthropic": "^1.0.6",
|
||||||
"@ai-sdk/azure": "^1.0.15",
|
"@ai-sdk/azure": "^1.0.15",
|
||||||
|
|||||||
@@ -131,3 +131,5 @@ export {
|
|||||||
|
|
||||||
export * from "./utils/schedules/utils";
|
export * from "./utils/schedules/utils";
|
||||||
export * from "./utils/schedules/index";
|
export * from "./utils/schedules/index";
|
||||||
|
|
||||||
|
export * from "./lib/logger";
|
||||||
|
|||||||
11
packages/server/src/lib/logger.ts
Normal file
11
packages/server/src/lib/logger.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import pino from "pino";
|
||||||
|
|
||||||
|
export const logger = pino({
|
||||||
|
transport: {
|
||||||
|
target: "pino-pretty",
|
||||||
|
options: {
|
||||||
|
colorize: true,
|
||||||
|
levelFirst: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -35,7 +35,7 @@ export const generateRandomDomain = ({
|
|||||||
projectName,
|
projectName,
|
||||||
}: Schema): string => {
|
}: Schema): string => {
|
||||||
const hash = randomBytes(3).toString("hex");
|
const hash = randomBytes(3).toString("hex");
|
||||||
const slugIp = serverIp.replaceAll(".", "-");
|
const slugIp = serverIp.replaceAll(".", "-").replaceAll(":", "-");
|
||||||
|
|
||||||
return `${projectName}-${hash}${slugIp === "" ? "" : `-${slugIp}`}.traefik.me`;
|
return `${projectName}-${hash}${slugIp === "" ? "" : `-${slugIp}`}.traefik.me`;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { runMySqlBackup } from "./mysql";
|
|||||||
import { runPostgresBackup } from "./postgres";
|
import { runPostgresBackup } from "./postgres";
|
||||||
import { runWebServerBackup } from "./web-server";
|
import { runWebServerBackup } from "./web-server";
|
||||||
import { runComposeBackup } from "./compose";
|
import { runComposeBackup } from "./compose";
|
||||||
|
import { logger } from "@dokploy/server/lib/logger";
|
||||||
|
|
||||||
export const scheduleBackup = (backup: BackupSchedule) => {
|
export const scheduleBackup = (backup: BackupSchedule) => {
|
||||||
const {
|
const {
|
||||||
@@ -222,6 +223,17 @@ export const getBackupCommand = (
|
|||||||
) => {
|
) => {
|
||||||
const containerSearch = getContainerSearchCommand(backup);
|
const containerSearch = getContainerSearchCommand(backup);
|
||||||
const backupCommand = generateBackupCommand(backup);
|
const backupCommand = generateBackupCommand(backup);
|
||||||
|
|
||||||
|
logger.info(
|
||||||
|
{
|
||||||
|
containerSearch,
|
||||||
|
backupCommand,
|
||||||
|
rcloneCommand,
|
||||||
|
logPath,
|
||||||
|
},
|
||||||
|
`Executing backup command: ${backup.databaseType} ${backup.backupType}`,
|
||||||
|
);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
set -eo pipefail;
|
set -eo pipefail;
|
||||||
echo "[$(date)] Starting backup process..." >> ${logPath};
|
echo "[$(date)] Starting backup process..." >> ${logPath};
|
||||||
|
|||||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -363,7 +363,13 @@ importers:
|
|||||||
version: 1.2.0(zod@3.25.7)
|
version: 1.2.0(zod@3.25.7)
|
||||||
otpauth:
|
otpauth:
|
||||||
specifier: ^9.2.3
|
specifier: ^9.2.3
|
||||||
|
version: 9.3.4
|
||||||
|
pino:
|
||||||
|
specifier: 9.4.0
|
||||||
version: 9.4.0
|
version: 9.4.0
|
||||||
|
pino-pretty:
|
||||||
|
specifier: 11.2.2
|
||||||
|
version: 11.2.2
|
||||||
postgres:
|
postgres:
|
||||||
specifier: 3.4.4
|
specifier: 3.4.4
|
||||||
version: 3.4.4
|
version: 3.4.4
|
||||||
@@ -701,7 +707,13 @@ importers:
|
|||||||
version: 1.2.0(zod@3.25.7)
|
version: 1.2.0(zod@3.25.7)
|
||||||
otpauth:
|
otpauth:
|
||||||
specifier: ^9.2.3
|
specifier: ^9.2.3
|
||||||
|
version: 9.3.4
|
||||||
|
pino:
|
||||||
|
specifier: 9.4.0
|
||||||
version: 9.4.0
|
version: 9.4.0
|
||||||
|
pino-pretty:
|
||||||
|
specifier: 11.2.2
|
||||||
|
version: 11.2.2
|
||||||
postgres:
|
postgres:
|
||||||
specifier: 3.4.4
|
specifier: 3.4.4
|
||||||
version: 3.4.4
|
version: 3.4.4
|
||||||
|
|||||||
Reference in New Issue
Block a user