适用于Docker应用程序的AWS上的持久性UGC文件存储 [英] Persistent UGC File Storage on AWS For Docker Application

查看:73
本文介绍了适用于Docker应用程序的AWS上的持久性UGC文件存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于docker的Flask应用程序正在开发中,并且即将完成.我目前正在将其托管在AWS上.该应用程序允许用户生成各种形式的内容(通常是图像文件),这些内容保存在我的开发环境中的应用程序的/static文件夹内的UGC文件夹中.这种临时解决方案在开发人员中效果很好,但是当移植到现场时还不够用,因为每次更新映像时都会破坏static/ugc文件夹.

I have a docker-based Flask app that I have been developing and it's nearing completion. I am currently moving to hosting it on AWS. The app allows users to generate various forms of content (usually image files) that are saved into a UGC folder within the /static folder of the app in my dev environment. This temporary solution worked fine in dev but it isn't going to suffice when ported to live as the static/ugc folder will be destroyed with each image update.

因此,我需要替代解决方案,并且一直在研究EFS.有人有这项服务的经验吗?还是通常在Docker应用容器之外托管持久性静态文件,并且可以建议?

I therefore need an alternative solution and have been investigating EFS. Does anybody have experience with this service? Or in hosting persistent static files outside of a Docker app container in general and could advise?

谢谢.

推荐答案

您可能应该考虑使用 S3对象存储服务,通过 boto3 python客户端.

You should probably look at using the S3 object storage service, via the boto3 python client.

还有一个烧瓶扩展名 Flask-S3 S3上的常规资产自动.您可能需要自己编写用户上传内容的逻辑.

There's also a flask extension, Flask-S3 which allows you to host general assets on S3 automatically. You'd probably need to code the logic for user-uploaded content yourself.

这篇关于适用于Docker应用程序的AWS上的持久性UGC文件存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆