In the previous section, 2 Deploy on Local, we manually deployed the following:
As mentioned before, there were several limitations in this approach. Now, we’ll deploy the infrastructure on the cloud using Docker, eliminating the need to download and install everything manually. If you’re familiar with Docker basics (especially networking), this part will not be too challenging.
In the earlier 4 Configure RDS step, we already configured the Database Server using Amazon RDS, so we no longer need to worry much about maintenance, access security, or data safety. Now, in this cloud deployment, we’ll focus on deploying the remaining applications using Docker Images.
Next, we’ll deploy using Docker Compose so you can see the difference between deploying on Local, deploying with Docker Images on the Cloud, and deploying with Docker Compose on the Cloud.
In the 2 Deploy on Local section, you can consider this as deploying in a development environment, but now we’ll deploy in a production or testing environment.
sudo nano .env

cd backend to navigate to the backend folder. Now the web server is ready to run.docker build -t aws-fcaj-container-app-backend .

sudo docker network create my-network
sudo docker run -p 5000:5000 --network my-network --name backend aws-fcaj-container-app-backend

cd frontend to navigate to the frontend folderdocker build -t aws-fcaj-container-app-frontend .

sudo docker run -p 3000:80 --network my-network --name frontend aws-fcaj-container-app-frontend
