Execute the following commands:
sudo yum update -y
sudo yum install docker -y
sudo systemctl start docker
sudo docker run hello-world
sudo systemctl enable docker
docker --version
sudo usermod -a -G docker $(whoami)
newgrp docker
sudo usermod -a -G docker $(whoami)
newgrp docker
Create folder and download source code:
mkdir -p challenge-day2/backend && cd challenge-day2/backend
wget <https://tcb-public-events.s3.amazonaws.com/mdac/resources/day2/cloudmart-backend.zip>
unzip cloudmart-backend.zip
Create .env
file:
nano .env
Content of .env
:
PORT=5000
AWS_REGION=us-east-1
BEDROCK_AGENT_ID=<your-bedrock-agent-id>
BEDROCK_AGENT_ALIAS_ID=<your-bedrock-agent-alias-id>
OPENAI_API_KEY=<your-openai-api-key>
OPENAI_ASSISTANT_ID=<your-openai-assistant-id>
Create Dockerfile:
nano Dockerfile
Content of Dockerfile:
FROM node:18
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5000
CMD ["npm", "start"]
Create folder and download source code:
cd ..
mkdir frontend && cd frontend
wget <https://tcb-public-events.s3.amazonaws.com/mdac/resources/day2/cloudmart-frontend.zip>
unzip cloudmart-frontend.zip