Im not sure, never tried. It shouldn’t delete any files as on railway.app your app doesn’t sleep.
But it would be stupid to host files there as it would consume your bandwidth and its better to host on some bucket with cdn. Like s3, or buckblaze
edit: on buckblaze you have 10GB free and if you proxy it with cloudflare you dont pay for bandwith
here is tutorial how to setup BuckBlaze bucket with cloudflare CDN, also you can use Strapi AWS S3 to upload images/files in buckblaze bucket only thing you will need at moment is edit link on your frontend as for now strapi doesnt have cdn links.
this is my setup in plugins.js so that allows me to upload to BuckBlaze B2 bucket using AWS-S3 provider. at moment CDN parametar is not working when i deploy it as i customized it, and its not uploaded when i deploy it, be we all hope that Strapi will soon allow CDN for all upload providers.
upload: {
config: {
provider: 'aws-s3',
providerOptions: {
accessKeyId: process.env.C1_backblaze_keyID,
secretAccessKey: process.env.C2_backblaze_applicationKey,
region: process.env.C3_backblaze_region,
params: {
Bucket: process.env.C4_backblaze_keyName,
},
endpoint:process.env.C5_endpoint, //workings
baseUrl: process.env.C6_CDN,
},
},
},
EDIT 2: if you are using my setup like here on top. you can add custom plugin and in src/plugins/<your-plugin-name>/server/bootstrap.js
add this:
'use strict';
module.exports = ({ strapi }) => {
// bootstrap phase
strapi.db.lifecycles.subscribe({
models: ['plugin::upload.file'],
// your lifecycle hooks
//
async beforeCreate(event) {
const { params } = event;
if(!!strapi.config.get('plugin.upload.providerOptions.baseUrl')){
params.data.url="https://"+strapi.config.get('plugin.upload.providerOptions.baseUrl')+'/'+params.data.hash+params.data.ext
if(!!params.data.formats){
if(!!params.data.formats.thumbnail){
params.data.formats.thumbnail.url="https://"+strapi.config.get('plugin.upload.providerOptions.baseUrl')+'/'+params.data.formats.thumbnail.hash+params.data.formats.thumbnail.ext
}
if(!!params.data.formats.large){
params.data.formats.large.url="https://"+strapi.config.get('plugin.upload.providerOptions.baseUrl')+'/'+params.data.formats.large.hash+params.data.formats.large.ext
}
if(!!params.data.formats.medium){
params.data.formats.medium.url="https://"+strapi.config.get('plugin.upload.providerOptions.baseUrl')+'/'+params.data.formats.medium.hash+params.data.formats.medium.ext
}
if(!!params.data.formats.small){
params.data.formats.small.url="https://"+strapi.config.get('plugin.upload.providerOptions.baseUrl')+'/'+params.data.formats.small.hash+params.data.formats.small.ext
}
}
}
},
}),
};
and you will have cdn link for your images. now only thing you need to do is add your cdn link in your security. LINK