SolidJSS
SolidJSโ€ข10mo ago
binajmen

Spooky behaviour while deploying in production

Hi everyone, I'm having a hard time to deploy solid start.

I'm using docker on a VPS, and from one deployment to another, the bundled assets are sometimes corrupted. I noticed two strange behaviours so far:

  1. Some bundled assets seems incomplete
This is an error I get when visiting a broken page:
SyntaxError: Invalid or unexpected token (at select-Ca0Q99V8.js:1:1827)

And indeed this is the end of the file:
...={data:[{id:"df1",points:100,requirement:"

Literally closing on
"


  1. Some link are strangely leading to other page content :
If I visit the link
/foo
, it shows me the content of
/bar
.

I can re-run the deploy several time, and at some point it works.. ๐Ÿ‘€
Here is the script I use:

#!/bin/bash
# Aggressive cleanup
echo "๐Ÿงน Performing thorough cleanup..."
docker image prune -f
docker builder prune -f # Clean build cache

echo "๐Ÿ“ฅ Pulling latest changes..."
git pull origin main

# Generate new build tag
export BUILD_TAG=$(date +%Y%m%d_%H%M%S)
echo "๐Ÿท๏ธ  New build tag: $BUILD_TAG"

echo "๐Ÿ—๏ธ  Building new images..."
# Use buildkit for better caching behavior
export DOCKER_BUILDKIT=1
docker compose build --no-cache --progress=plain

echo "โฌ‡๏ธ  Taking down current containers..."
docker compose down

echo "โฌ†๏ธ  Starting new containers..."
docker compose up -d

echo "๐Ÿ“‹ Showing logs..."
docker compose logs -f
Was this page helpful?