Setting Up the Foundation: Docker Images and Registry
23%
Docker Images
Before deploying our microservices containers, we need to create Docker images for them. Start by creating a Dockerfile for the menu service:
cat <$HOME/RestQR/menu/Dockerfile
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]
EOF
Create a Dockerfile for the qr service:
cat <$HOME/RestQR/qr/Dockerfile
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]
EOF
Since the menu service requires a PostgreSQL database, we need to create a Dockerfile for the database. We are going to use the Bitnami PostgreSQL image since we are going to deploy the database using Helm later in this guide:
DevSecOps in Practice
A Hands-On Guide to Operationalizing DevSecOps at ScaleEnroll now to unlock all content and receive all future updates for free.
