You're a DevOps engineer at esc bash. A developer hands you a small Python web service and asks you to containerize it properly so it can run the same way everywhere - built cleanly, cache-friendly, and not running as root.
Run this first. It creates /root/orders-web with the app source:
curl -fsSL https://raw.githubusercontent.com/Esc-Bash/project-init-scripts/main/docker/project-1/init.sh | bash
This drops in app.py (a small web app that serves esc bash orders v1
on its root path and listens on port 8000) and a requirements.txt.
Do not change these files - your job is to containerize them.
In /root/orders-web, produce:
.dockerignore that excludes at least __pycache__.Dockerfile that:
python:3.12-slimrequirements.txt is copied and installed with pip
before the rest of the source is copied with COPY . .orders-web:1.0.orders that publishes host port 8080 to
the app's port 8000.When it works, curl http://localhost:8080/ returns esc bash orders v1, and the container runs as a non-root user. Everything here was
covered across the Dockerfile topics.
Press Submit when the service is running.
Start the lab on the right to run checks.