(fix) Documenso: fix build failures (#4382)

- change build command
- change port in ENV file; remove unneeded sed cmds
- change systemd service file
- ensure turbo daemon is stopped to prevent hang on exit
This commit is contained in:
Chris 2025-05-10 17:23:51 -04:00 committed by GitHub
parent 990ce16a7d
commit 42535e14ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 70 additions and 66 deletions

View File

@ -42,9 +42,14 @@ function update_script() {
mv documenso-${RELEASE} /opt/documenso
cd /opt/documenso
mv /opt/.env /opt/documenso/.env
$STD npm install
$STD npm run build:web
export TURBO_CACHE=1
export NEXT_TELEMETRY_DISABLED=1
export CYPRESS_INSTALL_BINARY=0
export NODE_OPTIONS="--max-old-space-size=4096"
$STD npm ci
$STD turbo run build --filter=@documenso/remix
$STD npm run prisma:migrate-deploy
$STD turbo daemon stop
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"

View File

@ -73,9 +73,7 @@ sed -i \
-e "s|^NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=.*|NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY='$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)'|" \
-e "s|^DOCUMENSO_ENCRYPTION_KEY=.*|DOCUMENSO_ENCRYPTION_KEY='$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)'|" \
-e "s|^DOCUMENSO_ENCRYPTION_SECONDARY_KEY=.*|DOCUMENSO_ENCRYPTION_SECONDARY_KEY='$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)'|" \
-e "s|^NEXTAUTH_URL=.*|NEXTAUTH_URL=\"http://${LOCAL_IP}:3000\"|" \
-e "s|^NEXT_PUBLIC_WEBAPP_URL=.*|NEXT_PUBLIC_WEBAPP_URL='http://${LOCAL_IP}:9000'|" \
-e "s|^NEXT_PUBLIC_MARKETING_URL=.*|NEXT_PUBLIC_MARKETING_URL=\"http://${LOCAL_IP}:3001\"|" \
-e "s|^NEXT_PUBLIC_WEBAPP_URL=.*|NEXT_PUBLIC_WEBAPP_URL='http://${LOCAL_IP}:3000'|" \
-e "s|^NEXT_PRIVATE_INTERNAL_WEBAPP_URL=.*|NEXT_PRIVATE_INTERNAL_WEBAPP_URL=\"http://${LOCAL_IP}:3000\"|" \
-e "s|^NEXT_PRIVATE_DATABASE_URL=.*|NEXT_PRIVATE_DATABASE_URL=\"postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME\"|" \
-e "s|^NEXT_PRIVATE_DIRECT_DATABASE_URL=.*|NEXT_PRIVATE_DIRECT_DATABASE_URL=\"postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME\"|" \
@ -85,7 +83,7 @@ export NEXT_TELEMETRY_DISABLED=1
export CYPRESS_INSTALL_BINARY=0
export NODE_OPTIONS="--max-old-space-size=4096"
$STD npm ci
$STD npm run build:web
$STD turbo run build --filter=@documenso/remix
$STD npm run prisma:migrate-deploy
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed Documenso"
@ -103,8 +101,8 @@ Description=Documenso Service
After=network.target postgresql.service
[Service]
WorkingDirectory=/opt/documenso/apps/web
ExecStart=/usr/bin/npm start
WorkingDirectory=/opt/documenso
ExecStart=/usr/bin/turbo run start --filter=@documenso/remix
Restart=always
EnvironmentFile=/opt/documenso/.env
@ -118,6 +116,7 @@ motd_ssh
customize
msg_info "Cleaning up"
$STD turbo daemon stop
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"