diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e50c72078..892e8ea14 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,51 +5,6 @@ on: branches: ["canary", "main"] jobs: - build-and-push-image-docs: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile.docs - push: true - tags: dokploy/docs:latest - platforms: linux/amd64 - - build-and-push-image-website: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile.website - push: true - tags: dokploy/website:latest - platforms: linux/amd64 - - build-and-push-cloud-image: runs-on: ubuntu-latest @@ -70,8 +25,12 @@ jobs: file: ./Dockerfile.cloud push: true tags: | - siumauricio/cloud:${{ github.ref_name == 'main' && 'main' || 'canary' }} + siumauricio/cloud:${{ github.ref_name == 'main' && 'latest' || 'canary' }} platforms: linux/amd64 + build-args: | + NEXT_PUBLIC_UMAMI_HOST=${{ secrets.NEXT_PUBLIC_UMAMI_HOST }} + NEXT_PUBLIC_UMAMI_WEBSITE_ID=${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }} + NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=${{ secrets.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY }} build-and-push-schedule-image: runs-on: ubuntu-latest @@ -93,7 +52,7 @@ jobs: file: ./Dockerfile.schedule push: true tags: | - siumauricio/schedule:${{ github.ref_name == 'main' && 'main' || 'canary' }} + siumauricio/schedule:${{ github.ref_name == 'main' && 'latest' || 'canary' }} platforms: linux/amd64 @@ -117,5 +76,5 @@ jobs: file: ./Dockerfile.server push: true tags: | - siumauricio/server:${{ github.ref_name == 'main' && 'main' || 'canary' }} + siumauricio/server:${{ github.ref_name == 'main' && 'latest' || 'canary' }} platforms: linux/amd64 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dbb79c89b..05256d571 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -71,10 +71,9 @@ Run the command that will spin up all the required services and files. pnpm run dokploy:setup ``` -Build the server package (If you make any changes after in the packages/server folder, you need to rebuild and run this command) - +Run this script ```bash -pnpm run server:build +pnpm run server:script ``` Now run the development server. @@ -243,30 +242,7 @@ export function generate(schema: Schema): Template { - If you want to show a domain in the UI, please add the prefix \_HOST at the end of the variable name. - Test first on a vps or a server to make sure the template works. -## Docs +## Docs & Website -To run the docs locally, run the following command: +To contribute to the Dokploy docs or website, please go to this [repository](https://github.com/Dokploy/website). -```bash -pnpm run docs:dev -``` - -To build the docs, run the following command: - -```bash -pnpm run docs:build -``` - -## Website - -To run the website locally, run the following command: - -```bash -pnpm run website:dev -``` - -To build the website, run the following command: - -```bash -pnpm run website:build -``` diff --git a/Dockerfile.cloud b/Dockerfile.cloud index ee9d0ef95..020ea3d69 100644 --- a/Dockerfile.cloud +++ b/Dockerfile.cloud @@ -12,7 +12,16 @@ RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib # Install dependencies RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --filter=@dokploy/server --filter=./apps/dokploy install --frozen-lockfile + # Deploy only the dokploy app +ARG NEXT_PUBLIC_UMAMI_HOST +ENV NEXT_PUBLIC_UMAMI_HOST=$NEXT_PUBLIC_UMAMI_HOST + +ARG NEXT_PUBLIC_UMAMI_WEBSITE_ID +ENV NEXT_PUBLIC_UMAMI_WEBSITE_ID=$NEXT_PUBLIC_UMAMI_WEBSITE_ID + +ARG NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY +ENV NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=$NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY ENV NODE_ENV=production RUN pnpm --filter=@dokploy/server build diff --git a/Dockerfile.docs b/Dockerfile.docs deleted file mode 100644 index 71b790ec3..000000000 --- a/Dockerfile.docs +++ /dev/null @@ -1,35 +0,0 @@ -FROM node:18-alpine 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 - - -# Install dependencies -RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --filter=./apps/docs --frozen-lockfile - -# Deploy only the dokploy app - -ENV NODE_ENV=production -RUN pnpm --filter=./apps/docs run build -RUN pnpm --filter=./apps/docs --prod deploy /prod/docs - -RUN cp -R /usr/src/app/apps/docs/.next /prod/docs/.next - -FROM base AS dokploy -WORKDIR /app - -# Set production -ENV NODE_ENV=production - -# Copy only the necessary files -COPY --from=build /prod/docs/.next ./.next -COPY --from=build /prod/docs/public ./public -COPY --from=build /prod/docs/package.json ./package.json -COPY --from=build /prod/docs/node_modules ./node_modules - -EXPOSE 3000 -CMD HOSTNAME=0.0.0.0 && pnpm start \ No newline at end of file diff --git a/Dockerfile.website b/Dockerfile.website deleted file mode 100644 index 9932f5271..000000000 --- a/Dockerfile.website +++ /dev/null @@ -1,35 +0,0 @@ -FROM node:18-alpine 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 - - -# Install dependencies -RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --filter=./apps/website --frozen-lockfile - -# Deploy only the dokploy app - -ENV NODE_ENV=production -RUN pnpm --filter=./apps/website run build -RUN pnpm --filter=./apps/website --prod deploy /prod/website - -RUN cp -R /usr/src/app/apps/website/.next /prod/website/.next - -FROM base AS dokploy -WORKDIR /app - -# Set production -ENV NODE_ENV=production - -# Copy only the necessary files -COPY --from=build /prod/website/.next ./.next -COPY --from=build /prod/website/public ./public -COPY --from=build /prod/website/package.json ./package.json -COPY --from=build /prod/website/node_modules ./node_modules - -EXPOSE 3000 -CMD HOSTNAME=0.0.0.0 && pnpm start \ No newline at end of file diff --git a/README.md b/README.md index c7f7910b7..2e784812c 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com).
#### Organizations: diff --git a/apps/api/src/schema.ts b/apps/api/src/schema.ts index 4655f0063..5f26e0182 100644 --- a/apps/api/src/schema.ts +++ b/apps/api/src/schema.ts @@ -8,7 +8,7 @@ export const deployJobSchema = z.discriminatedUnion("applicationType", [ server: z.boolean().optional(), type: z.enum(["deploy", "redeploy"]), applicationType: z.literal("application"), - serverId: z.string(), + serverId: z.string().min(1), }), z.object({ composeId: z.string(), @@ -17,7 +17,7 @@ export const deployJobSchema = z.discriminatedUnion("applicationType", [ server: z.boolean().optional(), type: z.enum(["deploy", "redeploy"]), applicationType: z.literal("compose"), - serverId: z.string(), + serverId: z.string().min(1), }), ]); diff --git a/apps/api/src/types.ts b/apps/api/src/types.ts deleted file mode 100644 index 2547432bc..000000000 --- a/apps/api/src/types.ts +++ /dev/null @@ -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; - }; -} diff --git a/apps/api/src/utils.ts b/apps/api/src/utils.ts index 01b83a77c..2654487fe 100644 --- a/apps/api/src/utils.ts +++ b/apps/api/src/utils.ts @@ -1,45 +1,12 @@ import { - deployApplication, - deployCompose, deployRemoteApplication, deployRemoteCompose, - rebuildApplication, - rebuildCompose, rebuildRemoteApplication, rebuildRemoteCompose, updateApplicationStatus, updateCompose, } from "@dokploy/server"; 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{children}
- ), - li: ({ children, id }) => ( -+
{template.description}
diff --git a/apps/dokploy/components/dashboard/requests/show-requests.tsx b/apps/dokploy/components/dashboard/requests/show-requests.tsx index 1b066529b..643d2bcb9 100644 --- a/apps/dokploy/components/dashboard/requests/show-requests.tsx +++ b/apps/dokploy/components/dashboard/requests/show-requests.tsx @@ -34,7 +34,7 @@ export const ShowRequests = () => {+ You have {servers?.length} server on your plan of{" "} + {admin?.serversQuantity} servers +
++ $ {calculatePrice(serverQuantity, isAnnual).toFixed(2)}{" "} + USD +
+ | ++ ${" "} + {( + calculatePrice(serverQuantity, isAnnual) / 12 + ).toFixed(2)}{" "} + / Month USD +
++ $ {calculatePrice(serverQuantity, isAnnual).toFixed(2)}{" "} + USD +
+ )} ++ {product.description} +
+ +