Declare the Stack
Replace hand-typed docker run commands with a compose file.
A advanced Docker challenge worth 20 points. Solve it hands-on in a real Docker environment in your browser - no local setup, no fake shells.
The Challenge
Scenario: Every deploy, someone forgets a flag in the hand-typed docker run commands for web + cache. Codify the stack.
The requirements are in /root/stack/README.md:
Tasks: write docker-compose.yml in /root/stack with:
- service
web: imagenginx:alpine, port 8088:80,./htmlmounted read-only at/usr/share/nginx/html, restartunless-stopped - service
cache: imageredis:7-alpine, named volumecache-dataat/data - Bring it up:
docker compose up -d— browser panel on port 8088 shows Compose Stack Online
Commands to learn: compose file syntax, docker compose up/ps/logs
Run check when done.