Deploy Rails spree to Beanstalk - amazon-web-services

I have deployed rails spree app to AWS Beanstalk successfully. Then I added some new products together with their images. The app by default saves the images in my_app/public/spree/products folder. Every thing went fine until I deployed new code. The new code is deployed successfully but the "products" folder is gone. I now have to re-upload all of my images manually. Anyone has any idea what is going here?
Please let me know if you need any further info.
Thanks!!

Application will contain a public folder and under of this, we have spree products/taxons images folder...Those files are static by nature, so it’s a good idea to serve them using S3 because for every deployment our code replace.

Elastic beanstalk servers are somehow out of your control, meaning AWS controls when they are restarted and even terminated and rebuilt. Therefore, you shouldn't store anything on local disks (which is what Spree does by default).
The solution to your problem is simply to store them on S3 as described here.

Related

Unable to send bundle from aws app deployed using aws copilot via github actions

I have deployed my application using copilot deploy which works. It creates a load balancer and when I go to the designated url I can view my react app. However, I'm trying to create a CI workflow using github actions.
My github actions appear to work, they appear to deploy the app. But when I go to the new designated url, I get Uncaught SyntaxError: Unexpected token '<'
If I go to that same url and hit a specific route on it, that actually does work. So I can do url/test and it return "hello world" but it won't return the bundle for the application or it's returning a broken version of it for some reason.
I can't figure out why using copilot deploy normally works, but this doesn't
For context, my app is set up like this. In the root folder there is a Server folder that has the node server file with the routes. In the root folder is also a src folder with the react code. There is a public file. There is the docker file containing instructions. And then there is the build file. So far I've been generating the build ahead of time and then deploying everything. The node server then sends the build.
So presumably, something about the way the docker container is being built via github actions is significantly different than the way it is building using copilot deploy. But, my understanding is that in both cases it is following the same docker file. So I can't figure out what is different about the directory structure it is creating, or maybe its having trouble creating the bundle at all. If anyone has any insight it would be appreciated.
Thanks!

How to update package/dependencies on live django website?

I have created a django website which now I am looking to deploy through DigitalOcean, I have not uploaded it yet because I want to get a clear picture before actually starting.
My questions are,
How to I update the packages required for my website once I have deployed my website?
Eg: I am using CKEditor 6. In future, when CKEditor 7 arrives how do I update the package so that my
website uses the latest CKEditor without losing any data.
DigitalOcean deployment works with and without git right? So should I skip git, because I really do not
care about versioning my website. Simple update through FTP apps(WinSCP, Filezilla) will work for me.
Generally speaking remote server is no different from a local machine what stays in your bedroom. Yes, it doesn't have monitor, yes, it is a rack with a lot of wires and yes, it is usually far away from you, but afterall the logic is the same. Thus everything works almost the same way it does on your local computer. Yes, you will be able to update dependencies, yes you will be able to not use git. But the fact you may not use git, doesn't mean that you should not. Also you will have to think of another DB, proxy server and intermediary between such and django app.

Azure Deployment not picking up SSL certificates in repo

I'm currently running a Django app on the Azure server. I have a MySQL database to access using SSL. The SSL certificates I need to access the server are physically in the repo and I got my Django settings file to point to these using a relative path.
I have Azure set up to do continuous deployment from BitBucket. Problem is, at the end of the deployment, it will copy over all the files EXCEPT for the .pem files that I need.
I have to manually copy over the certificates everytime I push a commit. The files are in static/certs/*.pem
Is there something wrong with Azure? Or BitBucket? Or is there a better way of doing this?
I figured it out. Anything put manually inside the static folder gets cleaned out by Azure during deployment.
Just don't put anything inside the static folder

how to run a static site on bitnami and AWS?

I am quite a noob when it comes to cloud based apps, this is a completely new context for me. I currently got the github education pack, part of it was an account on bitnami. I was wondering if it's possible to host a static html site on bitnami, I tried a few things but so far I got no where. I know that i can deploy a wordpress or drupal instance and then I can configure a theme for those, but I just want a simple static html site to run. Any guidance on how I can do that?
To host static website using Bitnami try following steps.
Run an AWS instance from marketplace using 'LAMP Stack powered by Bitnami' AMI. This AMI will have pre-configured LAMP stack.
Attach EIP to your Instance
Upload you website files to /var/www/html/
Type your EIP in browser and if everything went right you should be able to see your website.
Do you really want a static website on Bitnami or it could be in another platform?
Because you could host one on GitHub Pages. Just follow the guide.
To host a super fast static site using a bitnami provided image I would use an nginx based stack such as: https://wiki.bitnami.com/Infrastructure_Stacks/Bitnami_Nginx_Stack

i'm confused about django statice files during deployment

I'm about two months in with django. I've been following tutorials on youtube and such and one of the tutorials says that I have to use two servers when deploying my site. Django will be served from heroku and static files from amazon s3. I have to pay for two seperate servers to deploy a django app? I did not expect this and this would not be within my budget if this is so. Is he wrong or is this just for special cases like his? Any help would be appreciated
No, sounds like the video is a bit confusing. There is a distinction between static assets, ie the CSS/JS etc that makes up your site, and dynamic media, ie any user-uploaded content.
Heroku can quite happily serve static assets from the filesystem, and their docs on deploying Django state exactly how to do this. However you cannot store dynamically uploaded content on Heroku, since the filesystem is ephemeral. If your app allows this, you need to save them somewhere permanent such as S3.
Note however that S3 is really cheap; hosting media files there should only cost you pennies.
You don't need 2 different servers for deploying your django project. You can just use a single Amazon EC2 instance then install Nginx/Apache+Supervisor+Gunicorn+Python. After that, you just need to configure the location of your static files from your virtualhost. Here's a tutorial from digital ocean.