diff --git a/Dockerfile b/Dockerfile index 8c4321c..48c10c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,6 @@ ENV TZ=Asia/Shanghai WORKDIR /app COPY --from=builder /app/ppanel /app/ppanel -COPY --from=builder /build/etc /app/etc # Expose the port (optional) EXPOSE 8080 diff --git a/script/build_docker.sh b/script/build_docker.sh new file mode 100755 index 0000000..0548b3e --- /dev/null +++ b/script/build_docker.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# build-and-push.sh + +set -e + +cd /Users/Apple/vpn/ppanel-server +# 固定版本号为latest +VERSION=dev + +# 构建镜像 +echo "Building image with version: $VERSION" +docker build -f Dockerfile --platform linux/amd64 --build-arg TARGETARCH=amd64 -t registry.kxsw.us/ppanel/ario-server:$VERSION . +docker tag registry.kxsw.us/ppanel/ario-server:$VERSION registry.kxsw.us/ppanel/ario-server:latest + +# 推送镜像 +echo "Pushing image to registry.kxsw.us" +docker push registry.kxsw.us/ppanel/ario-server:$VERSION +docker push registry.kxsw.us/ppanel/ario-server:latest + +echo "Build and push completed successfully!" +# docker-compose exec certbot certbot certonly --webroot --webroot-path=/etc/letsencrypt -d api-dev.kxsw.us