diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5506e2ae37..0054b3b38e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -152,6 +152,7 @@ jobs: uses: docker/build-push-action@v3 with: context: ./docker/nocobase + file: Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: nocobase/nocobase:main,nocobase/nocobase:latest,${{ steps.meta.outputs.tags }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:main,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:latest,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }} @@ -160,6 +161,7 @@ jobs: uses: docker/build-push-action@v3 with: context: ./docker/nocobase + file: Dockerfile.next platforms: linux/amd64,linux/arm64 push: true tags: nocobase/nocobase:next,${{ steps.meta.outputs.tags }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:next,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }} diff --git a/docker/nocobase/Dockerfile.next b/docker/nocobase/Dockerfile.next new file mode 100644 index 0000000000..4f579e0729 --- /dev/null +++ b/docker/nocobase/Dockerfile.next @@ -0,0 +1,43 @@ +FROM node:18-bullseye-slim as builder + +WORKDIR /app + +RUN cd /app \ + && yarn config set network-timeout 600000 -g \ + && npx -y create-nocobase-app@next my-nocobase-app -a -e APP_ENV=production \ + && cd /app/my-nocobase-app \ + && yarn install --production + +RUN cd /app \ + && rm -rf nocobase.tar.gz \ + && tar -zcf ./nocobase.tar.gz -C /app/my-nocobase-app . + +FROM node:18-bullseye-slim + +# COPY ./sources.list /etc/apt/sources.list +RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ + && case "${dpkgArch##*-}" in \ + amd64) ARCH='x64';; \ + ppc64el) ARCH='ppc64le';; \ + s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ + armhf) ARCH='armv7l';; \ + i386) ARCH='x86';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac \ + && set -ex \ + # libatomic1 for arm + && apt-get update && apt-get install -y nginx + +RUN rm -rf /etc/nginx/sites-enabled/default +COPY --from=builder /app/nocobase.tar.gz /app/nocobase.tar.gz + +WORKDIR /app/nocobase + +COPY docker-entrypoint.sh /app/ +# COPY docker-entrypoint.sh /usr/local/bin/ +# ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 80/tcp + +CMD ["/app/docker-entrypoint.sh"]