Skip to content

Commit 2541832

Browse files
authored
Merge pull request #50 from Dokploy/canary
v0.0.2
2 parents de278d9 + 237a01d commit 2541832

File tree

11 files changed

+76
-87
lines changed

11 files changed

+76
-87
lines changed

.github/workflows/pull-request.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,6 @@ jobs:
3131
- name: Run Build
3232
run: pnpm build
3333

34-
35-
build-docker-on-pr:
36-
if: github.event_name == 'pull_request'
37-
needs: build-app
38-
runs-on: ubuntu-latest
39-
steps:
40-
- name: Check out the code
41-
uses: actions/checkout@v3
42-
43-
- name: Set up Docker Buildx
44-
uses: docker/setup-buildx-action@v3
45-
46-
- name: Prepare .env file
47-
run: |
48-
cp .env.production.example .env.production
49-
50-
- name: Run custom Docker build script
51-
run: |
52-
chmod +x ./docker/build.sh
53-
echo "Building Docker image for ${{ github.base_ref }}"
54-
./docker/build.sh ${{ github.base_ref == 'canary' && 'canary' || '' }}
55-
5634
build-and-push-docker-on-push:
5735
if: github.event_name == 'push'
5836
runs-on: ubuntu-latest
@@ -75,7 +53,5 @@ jobs:
7553
7654
- name: Build and push Docker image using custom script
7755
run: |
78-
chmod +x ./docker/build.sh
7956
chmod +x ./docker/push.sh
80-
./docker/build.sh ${{ github.ref_name == 'canary' && 'canary' || '' }}
8157
./docker/push.sh ${{ github.ref_name == 'canary' && 'canary' || '' }}

docker/build.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ else
1010
TAG="$VERSION"
1111
fi
1212

13-
docker build --platform linux/amd64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${TAG}" .
13+
BUILDER=$(docker buildx create --use)
1414

15-
if [ "$BUILD_TYPE" != "canary" ]; then
16-
# Tag the production build as latest
17-
docker tag "dokploy/dokploy:${TAG}" "dokploy/dokploy:latest"
18-
fi
15+
docker buildx build --platform linux/amd64,linux/arm64 --pull --rm -t "dokploy/dokploy:${TAG}" -f 'Dockerfile' .
16+
17+
docker buildx rm $BUILDER

docker/push.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
# Determine the type of build based on the first script argument
44
BUILD_TYPE=${1:-production}
55

6+
BUILDER=$(docker buildx create --use)
7+
68
if [ "$BUILD_TYPE" == "canary" ]; then
79
TAG="canary"
810
echo PUSHING CANARY
9-
docker push "dokploy/dokploy:${TAG}"
11+
docker buildx build --platform linux/amd64,linux/arm64 --pull --rm -t "dokploy/dokploy:${TAG}" -f 'Dockerfile' --push .
1012
else
1113
echo "PUSHING PRODUCTION"
1214
VERSION=$(node -p "require('./package.json').version")
13-
docker push "dokploy/dokploy:${VERSION}"
14-
docker push "dokploy/dokploy:latest"
15+
docker buildx build --platform linux/amd64,linux/arm64 --pull --rm -t "dokploy/dokploy:latest" -t "dokploy/dokploy:${VERSION}" -f 'Dockerfile' --push .
1516
fi
17+
18+
docker buildx rm $BUILDER

next.config.mjs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
/** @type {import("next").NextConfig} */
77
const nextConfig = {
88
reactStrictMode: true,
9-
logging:{
10-
fetches:{
11-
fullUrl:false
12-
}
13-
},
149

1510
/**
1611
* If you are using `appDir` then you must comment the below `i18n` config out.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dokploy",
3-
"version": "v0.0.1",
3+
"version": "v0.0.2",
44
"private": true,
55
"license": "AGPL-3.0-only",
66
"type": "module",

pnpm-lock.yaml

Lines changed: 50 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/api/routers/domain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const domainRouter = createTRPCRouter({
5252
.mutation(async ({ input }) => {
5353
const domain = await findDomainById(input.domainId);
5454
const result = await removeDomainById(input.domainId);
55-
removeDomain(domain.application.appName, domain.uniqueConfigKey);
55+
await removeDomain(domain.application.appName, domain.uniqueConfigKey);
5656

5757
return result;
5858
}),

server/api/services/application.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ export const createApplication = async (
3636
});
3737
}
3838

39-
createTraefikConfig(newApplication.appName);
40-
4139
if (process.env.NODE_ENV === "development") {
40+
createTraefikConfig(newApplication.appName);
4241
await tx.insert(domains).values({
4342
applicationId: newApplication.applicationId,
4443
host: `${newApplication.appName}.docker.localhost`,

server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ void app.prepare().then(async () => {
4848
await initializeNetwork();
4949
createDefaultTraefikConfig();
5050
createDefaultServerTraefikConfig();
51+
await initializePostgres();
5152
await initializeTraefik();
5253
await initializeRedis();
53-
await initializePostgres();
5454
initCronJobs();
5555
welcomeServer();
5656

server/utils/builders/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { buildPaketo } from "./paketo";
1717
// NIXPACKS codeDirectory = where is the path of the code directory
1818
// HEROKU codeDirectory = where is the path of the code directory
1919
// PAKETO codeDirectory = where is the path of the code directory
20-
// DOKERFILE codeDirectory = where is the exact path of the (Dockerfile)
20+
// DOCKERFILE codeDirectory = where is the exact path of the (Dockerfile)
2121
export type ApplicationNested = InferResultType<
2222
"applications",
2323
{ mounts: true; security: true; redirects: true; ports: true }

0 commit comments

Comments
 (0)