How can I make my containers pull static files from AWS at runtime?

0
11
Asked By CloudySkies42 On

I'm running a web app inside a container, and currently, all my static files are included in the image. I want to change this setup to make certain files fetch from AWS at runtime. Specifically, I'm curious about two things: first, can I use a cron job to fetch these files on startup and then check for updates every 30 seconds? Second, what's the best way to provide my AWS credentials to the containers? Also, just to clarify, the files I need are stored in a S3 bucket.

2 Answers

Answered By DevWonderer99 On

Instead of fetching files directly via a cron job, you could set up a secure endpoint in your app specifically for fetching updates. You might, for example, create a special health check endpoint that not only checks the container's status but also triggers a fetch for the latest files from your S3 bucket. Just a thought!

Answered By UserFriendly87 On

Fetching files from AWS means you'll be retrieving them from an S3 bucket, right? You can definitely set up a cron job to run on container startup. Just ensure the job pulls the updates regularly, say every 30 seconds, if you need it that frequent! It's all about scripting it right in your container's entry point.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.