diff --git a/.github/workflows/build-upload-deploy-prod.yml b/.github/workflows/build-upload-deploy-prod.yml index 5994f6d2ef..3e94c37022 100644 --- a/.github/workflows/build-upload-deploy-prod.yml +++ b/.github/workflows/build-upload-deploy-prod.yml @@ -80,10 +80,26 @@ jobs: - name: Build Target run: | - mkdir -p target/_next + rm -rf target .deploy-bundle + mkdir -p target/_next .deploy-bundle/.next + + cp -r .next/standalone/. .deploy-bundle/ cp -r .next/static target/_next/ - zip -r package.zip . -x '*.git*' 'node_modules/*' 'target/*' - mv package.zip target/ + cp -r .next/static .deploy-bundle/.next/ + cp -r public .deploy-bundle/ + cp Procfile .deploy-bundle/ + cp -r .ebextensions .deploy-bundle/ + + for file in BUILD_ID PUBLIC_RUNTIME.json ASSETS_FROM_S3; do + if [ -f ".next/$file" ]; then + cp ".next/$file" ".deploy-bundle/.next/$file" + fi + done + + ( + cd .deploy-bundle + zip -r ../target/package.zip . + ) - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.platform/hooks/prebuild/10-pnpm-runtime-install.sh b/.platform/hooks/prebuild/10-pnpm-runtime-install.sh deleted file mode 100755 index d3c5095153..0000000000 --- a/.platform/hooks/prebuild/10-pnpm-runtime-install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -euo pipefail - -# Install runtime dependencies with pnpm before Elastic Beanstalk's -# Node.js platform decides whether it needs to run npm install itself. -export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 - -corepack enable -corepack prepare pnpm@10.33.0 --activate - -pnpm --version -pnpm install --prod --frozen-lockfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000000..31ce8739fa --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: PORT=3001 HOSTNAME=0.0.0.0 node server.js diff --git a/config/nextConfig.ts b/config/nextConfig.ts index 0eafd97d98..0a964dd3d0 100644 --- a/config/nextConfig.ts +++ b/config/nextConfig.ts @@ -9,6 +9,7 @@ export function sharedConfig( ): NextConfig { return { assetPrefix, + output: "standalone", reactCompiler: true, reactStrictMode: false, compress: true,