The short answer
Your app runs in a container, and the container is replaced on every deploy. Its disk goes with it. Files your app saved there, such as uploads or generated images, are gone, and nothing reports an error. Save files to a bucket instead. Antideploy creates a private S3 bucket for your app, and your agent can set it up in one step.
How to tell
-
The app uses
multer,fs.writeFileor a localuploadsfolder. Antideploy flags uploads written to the app's own disk before it builds anything. -
Uploads work, then vanish after the next deploy or restart. A restart or a scale-to-zero has the same effect.
How to fix it
-
Ask your agent for a bucket
Say: "Store uploads in a bucket, not on disk." Your agent creates a private S3 bucket for the app and writes its variables into your
.env. -
Use an S3 client in your code
Replace the code that writes to disk with an upload to the bucket. The AWS SDKs and boto3 read the variables from the environment.
-
Serve files through your app, or with a signed link
The bucket is private. Hand the visitor a signed link, or serve the file through your app.
See how to add file uploads to your app for the code.