whitetown
overwrite files during deploy
Is it possible to overwrite a file(files) during deployment?
i.e. based on env variable I would like to replace some files in /public folder.
/images/
/public/
/src/
package.json
etc.
"build": "node copyfiles.js && next build",
copyfiles.js:
it does not produce any error but files are not copied. locally it works.
maybe files are read only?
31 replies
previous deployment crash
When I deploy the API (express, nodejs, socketio) everything goes well,
but right before the new deployment will replace the old one,
I see on the dashboard and I get an email notification
Deployment crashed for [service name] in [project name]! why this happens? is there something I can do? project id: b799250d-dd7b-47bb-be65-0ae878afd304
Deployment crashed for [service name] in [project name]! why this happens? is there something I can do? project id: b799250d-dd7b-47bb-be65-0ae878afd304
39 replies
could someone help me with volumes?
Hello,
could someone help me with volumes?
I used this code to upload the file to temp dir (it's working):
const tempDir = fs.mkdirSync(path.join(os.tmpdir(), String(new Date().getTime())), { recursive: true })
const result = []
for (const file of files) {
const filePath = path.join(tempDir, file.originalname)
fs.writeFileSync(filePath, file.buffer)
result.push(filePath)
}
return result
now I added a volume.
the mount path initially was /files , i.e.
const tempDir = '/files'
then I have tried to change it to /app/files , i.e.
const tempDir = '/app/files'
no luck
it cannot create a file there
43 replies