2024-04-28 23:57:52 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2024-05-01 19:44:41 -06:00
|
|
|
# Determine the type of build based on the first script argument
|
|
|
|
|
BUILD_TYPE=${1:-production}
|
2024-04-28 23:57:52 -06:00
|
|
|
|
2024-05-01 19:44:41 -06:00
|
|
|
if [ "$BUILD_TYPE" == "canary" ]; then
|
|
|
|
|
TAG="canary"
|
|
|
|
|
else
|
|
|
|
|
VERSION=$(node -p "require('./package.json').version")
|
|
|
|
|
TAG="$VERSION"
|
|
|
|
|
fi
|
2024-04-28 23:57:52 -06:00
|
|
|
|
2024-05-01 19:44:41 -06:00
|
|
|
docker build --platform linux/amd64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${TAG}" .
|
|
|
|
|
|
|
|
|
|
if [ "$BUILD_TYPE" != "canary" ]; then
|
|
|
|
|
# Tag the production build as latest
|
|
|
|
|
docker tag "dokploy/dokploy:${TAG}" "dokploy/dokploy:latest"
|
|
|
|
|
fi
|