Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Set up PNPM
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable && corepack prepare pnpm@10.22.0 --activate
# Set up Bun
ENV BUN_INSTALL="/home/node/.bun"
ENV PATH="$BUN_INSTALL/bin:$PATH"
RUN mkdir -p "$BUN_INSTALL" \
&& chown -R node:node "$BUN_INSTALL" \
&& su node -c "curl -fsSL https://bun.sh/install | bash -s -- bun-v1.3.14"

# Create workspace directory
WORKDIR /workspaces/dokploy

# Set up user permissions
USER node
USER node
99 changes: 99 additions & 0 deletions .github/workflows/bun-migration-docker-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Bun Migration Docker Check

on:
workflow_dispatch:
pull_request:
branches: [AgentHits-Dev]
paths:
- ".github/workflows/bun-migration-docker-check.yml"
- "Dockerfile"
- "Dockerfile.cloud"
- "Dockerfile.server"
- "Dockerfile.schedule"
- "apps/**"
- "packages/**"
- "package.json"
- "bun.lock"

permissions:
contents: read

jobs:
main-image-smoke:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Prepare production env file
run: |
cp apps/dokploy/.env.production.example .env.production
cp apps/dokploy/.env.production.example apps/dokploy/.env.production
echo "POSTGRES_PASSWORD=build-time-postgres-password" >> .env.production
echo "POSTGRES_PASSWORD=build-time-postgres-password" >> apps/dokploy/.env.production

- name: Build main image for smoke
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
load: true
push: false
tags: dokploy-bun-check:main
build-args: |
DOKPLOY_OFFICIAL_VERSION=ci-bun-check
DOKPLOY_FORK_VERSION=ci-bun-check

- name: Smoke main image
run: |
docker run --rm --entrypoint bun dokploy-bun-check:main --version
docker run --rm --entrypoint sh dokploy-bun-check:main -lc '
test -f /app/packages/server/dist/index.js
node --input-type=module -e "console.log(await import.meta.resolve(\"@dokploy/server\"))"
'

service-image-builds:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: cloud
file: ./Dockerfile.cloud
- name: server
file: ./Dockerfile.server
- name: schedule
file: ./Dockerfile.schedule
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Prepare production env file
run: |
cp apps/dokploy/.env.production.example .env.production
cp apps/dokploy/.env.production.example apps/dokploy/.env.production
echo "POSTGRES_PASSWORD=build-time-postgres-password" >> .env.production
echo "POSTGRES_PASSWORD=build-time-postgres-password" >> apps/dokploy/.env.production

- name: Build ${{ matrix.name }} image
uses: docker/build-push-action@v7
with:
context: .
file: ${{ matrix.file }}
load: true
push: false
tags: dokploy-bun-check:${{ matrix.name }}

- name: Smoke ${{ matrix.name }} image
run: |
docker run --rm --entrypoint bun dokploy-bun-check:${{ matrix.name }} --version
docker run --rm --entrypoint sh dokploy-bun-check:${{ matrix.name }} -lc '
test -f /app/packages/server/dist/index.js
node --input-type=module -e "console.log(await import.meta.resolve(\"@dokploy/server\"))"
'
11 changes: 6 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ jobs:
job: [build, test, typecheck]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- uses: actions/setup-node@v4
with:
node-version: 24.4.0
cache: "pnpm"

- name: Install Nixpacks
if: matrix.job == 'test'
Expand All @@ -46,6 +47,6 @@ jobs:
docker network create --driver overlay dokploy-network || true
echo "✅ Docker Swarm initialized"

- run: pnpm install --frozen-lockfile
- run: pnpm server:build
- run: pnpm ${{ matrix.job }}
- run: bun install --frozen-lockfile
- run: bun run server:build
- run: bun run ${{ matrix.job }}
10 changes: 5 additions & 5 deletions .github/workflows/sync-openapi-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- uses: actions/setup-node@v4
with:
node-version: 24.4.0
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile

- name: Generate OpenAPI specification
run: |
pnpm generate:openapi
bun run generate:openapi

# Verifica que se generó correctamente
if [ ! -f openapi.json ]; then
Expand Down Expand Up @@ -130,4 +131,3 @@ jobs:
git push

echo "✅ OpenAPI synced to SDK repository successfully"

18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ We use Node v24.4.0 and recommend this specific version. If you have nvm install
```bash
git clone https://github.com/dokploy/dokploy.git
cd dokploy
pnpm install
bun install
cp apps/dokploy/.env.example apps/dokploy/.env
```

Expand All @@ -71,19 +71,19 @@ cp apps/dokploy/.env.example apps/dokploy/.env
Run the command that will spin up all the required services and files.

```bash
pnpm run dokploy:setup
bun run dokploy:setup
```

Run this script

```bash
pnpm run server:script
bun run server:script
```

Now run the development server.

```bash
pnpm run dokploy:dev
bun run dokploy:dev
```

Go to http://localhost:3000 to see the development server
Expand All @@ -94,7 +94,7 @@ Go to http://localhost:3000 to see the development server
## Build

```bash
pnpm run dokploy:build
bun run dokploy:build
```

## Docker
Expand All @@ -109,27 +109,27 @@ cp apps/dokploy/.env.production.example apps/dokploy/.env.production
then run build command

```bash
pnpm run docker:build
bun run --filter './apps/dokploy' docker:build
```

To push the docker image

```bash
pnpm run docker:push
bun run --filter './apps/dokploy' docker:push
```

## Password Reset

In the case you lost your password, you can reset it using the following command

```bash
pnpm run reset-password
bun run --filter './apps/dokploy' reset-password
```

If you want to test the webhooks on development mode using localtunnel, make sure to install [`localtunnel`](https://localtunnel.app/)

```bash
pnpm dlx localtunnel --port 3000
bunx localtunnel --port 3000
```

If you run into permission issues of docker run the following command
Expand Down
56 changes: 31 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# syntax=docker/dockerfile:1
FROM node:24.4.0-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME/bin:$PNPM_HOME:$PATH"
ENV PNPM_CONFIG_MINIMUM_RELEASE_AGE=0
ENV PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false
RUN npm install -g corepack@0.35.0 \
&& corepack enable \
&& corepack prepare pnpm@11.10.0 --activate
ENV BUN_INSTALL="/root/.bun"
ENV PATH="$BUN_INSTALL/bin:$PATH"
RUN apt-get update \
&& apt-get install -y --no-install-recommends bash ca-certificates curl unzip \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL https://bun.sh/install | bash -s -- bun-v1.3.14 \
&& ln -sf "$BUN_INSTALL/bin/bun" "$BUN_INSTALL/bin/bunx" \
&& npm install -g node-gyp@13.0.1

FROM base AS build
ARG DOKPLOY_OFFICIAL_VERSION=v0.29.8
Expand All @@ -19,15 +20,28 @@ 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/*

# Install dependencies
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN --mount=type=cache,id=bun,target=/root/.bun/install/cache bun install --frozen-lockfile

# Deploy only the dokploy app

ENV NODE_ENV=production
RUN pnpm --filter=@dokploy/server build
RUN pnpm --filter=./apps/dokploy run build

RUN pnpm --filter=./apps/dokploy --prod deploy --legacy /prod/dokploy
RUN bun run --filter './packages/server' build
RUN bun run --filter './apps/dokploy' build

RUN bun install --production --frozen-lockfile --linker hoisted

RUN mkdir -p /prod/dokploy \
&& cp -R /usr/src/app/apps/dokploy/package.json /prod/dokploy/package.json \
&& cp -R /usr/src/app/apps/dokploy/next.config.mjs /prod/dokploy/next.config.mjs \
&& cp -R /usr/src/app/apps/dokploy/public /prod/dokploy/public \
&& cp -R /usr/src/app/apps/dokploy/drizzle /prod/dokploy/drizzle \
&& cp -R /usr/src/app/apps/dokploy/components.json /prod/dokploy/components.json \
&& cp -R /usr/src/app/node_modules /prod/dokploy/node_modules \
&& mkdir -p /prod/dokploy/packages \
&& cp -R /usr/src/app/packages/server /prod/dokploy/packages/server \
&& rm -f /prod/dokploy/node_modules/dokploy \
&& rm -f /prod/dokploy/node_modules/@dokploy/api \
&& rm -f /prod/dokploy/node_modules/@dokploy/schedules

RUN cp -R /usr/src/app/apps/dokploy/.next /prod/dokploy/.next
RUN cp -R /usr/src/app/apps/dokploy/dist /prod/dokploy/dist
Expand All @@ -54,6 +68,7 @@ COPY --from=build /prod/dokploy/drizzle ./drizzle
COPY .env.production ./.env
COPY --from=build /prod/dokploy/components.json ./components.json
COPY --from=build /prod/dokploy/node_modules ./node_modules
COPY --from=build /prod/dokploy/packages ./packages


# Install docker
Expand All @@ -67,21 +82,12 @@ RUN curl -sSL https://nixpacks.com/install.sh -o install.sh \
&& chmod +x install.sh \
&& NIXPACKS_VERSION="$NIXPACKS_VERSION" ./install.sh -y \
&& rm install.sh \
&& pnpm install -g tsx
&& bun install -g tsx

# Install Railpack
ARG RAILPACK_VERSION=0.15.4
ARG TARGETARCH
RUN set -eux; \
case "${TARGETARCH:-amd64}" in \
amd64) railpack_arch="x86_64" ;; \
arm64) railpack_arch="arm64" ;; \
*) echo "Unsupported Railpack architecture: ${TARGETARCH}" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://github.com/railwayapp/railpack/releases/download/v${RAILPACK_VERSION}/railpack-v${RAILPACK_VERSION}-${railpack_arch}-unknown-linux-musl.tar.gz" -o railpack.tar.gz; \
tar -xzf railpack.tar.gz railpack; \
install -m 0755 railpack /usr/local/bin/railpack; \
rm railpack railpack.tar.gz
RUN curl -sSL https://railpack.com/install.sh \
| RAILPACK_VERSION="$RAILPACK_VERSION" bash -s -- --yes --bin-dir /usr/local/bin

# Install buildpacks
COPY --from=buildpacksio/pack:0.39.1 /usr/local/bin/pack /usr/local/bin/pack
Expand All @@ -91,4 +97,4 @@ EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=5 \
CMD curl -fs http://localhost:3000/api/trpc/settings.health || exit 1

CMD ["sh", "-c", "pnpm run wait-for-postgres && exec pnpm start"]
CMD ["sh", "-c", "bun run wait-for-postgres && exec bun run start"]
Loading
Loading