Question

What is the proper way to sync assets with Digital Ocean Space when precompiling assets?

Posted April 18, 2019 1.2k views
Ruby on RailsDokkuUbuntu 18.04

I deployed RoR application using Dokku On Digital Ocean droplet. I’m going to try DO Space CDN.
I’d like assets to be synchronised to S3 bucket after run bundle exec rake assets:precompile but I can’t find any info about how should precompiled assets be copied to DO space.
I read about ‘asset_sync’ gem but i’m not sure about it. Does anyone have some thoughts?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Because the Spaces API is compatible with AWS S3’s API you should be able to use most of the same gems and tooling that’s pre built for AWS.

For example fog-aws works with DigitalOcean spaces
https://github.com/fog/fog-aws

With that in mind you should be able to use asset_sync with Spaces.

Use your DigitalOcean Spaces Key instead of the AWS Key and use ${REGION}.digitaloceanspaces.com as your endpoint instead of the AWS S3 region endpoint.

Submit an Answer