- Pulling the new Docker images (Web and Worker).
- Applying Prisma database migrations.
Performing an Upgrade
Use the following sequence to safely upgrade your environment.Back up your database
Always perform a full
pg_dump of your production database before applying any application updates.Pull the latest code
If building from source, pull the latest changes from the upstream
main branch.Verify shared services for client instances
Before marking a client instance upgraded, confirm the environment has its shared runtime services wired into every app runtime service.For Railway client projects, verify:
- Redis exists in the same project and environment as the client app.
REDIS_URLand a client-specificREDIS_KEY_PREFIXare set on web and worker services.- A Railway bucket or another S3-compatible bucket exists for uploads.
S3_ENDPOINT,S3_BUCKET_NAME,AWS_S3_BUCKET_NAME,S3_REGION,S3_ACCESS_KEY_ID,S3_SECRET_ACCESS_KEY,S3_ACCESS_KEY, andS3_SECRET_KEYare set on web and worker services.- Web and worker have been redeployed after variable changes.
- The web health endpoint returns healthy and fresh logs do not include
StorageProvider: Missing S3/R2 endpoint.
Automatic Database Migrations
You generally do not need to run database migrations manually. The Corgtex Dockerfiles use anentrypoint.sh script that automatically runs npx prisma migrate deploy before starting the Next.js server or the Node worker.
This ensures that the database schema is strictly synchronized with the application code booting up in the container. If a migration fails, the container boot sequence will abort, protecting your database state.