AssetSync / asset_sync

Synchronises Assets between Rails and S3
1.88k stars 346 forks source link

How to setup if i have multiple app server #279

Open adz624 opened 10 years ago

adz624 commented 10 years ago

I have multiple stacks environment with 1 web and 2 app servers, asset_sync hooks task "upload assets to S3", I think it only have to upload once, but it seems run the task in each app server.

So how do i specify server to handle this task?

mbhnyc commented 9 years ago

Yeah, trying to solve this issue as well, we're deploying a cluster using Docker - how did you end up approaching this?

I assume we could save an intermediate container after asset sync and copy the manifest-md5hash.json file into all other app servers..OR mounting the assets folder separately after running the compile the first time. Anyway, fun fun.

adz624 commented 9 years ago

I have a deploy recipes gem that wrapper asset_sync and do some hack to change compile locally and sync assets from local, and this gem will upload manifest file to APP role, ASSETS files to web role or CDN.

https://github.com/afunction/visionbundles/wiki/%5BRecipe%5D-fast_assets

some dirty code there.

I just use docker few times, and never build own docker images, so i don't know how it work, but it may use same way to compile and sync assets when initial docker instance.

BTW: Are you using docker to build production environment?

mbhnyc commented 9 years ago

Yup!