# Compose file for a small web shop on web1.example.com (assignment Z9.3). # The lines marked [1] through [10] are the blocks of lines you assess. # On this server ufw is enabled: deny everything, except 22, 80 and 443. # A system nginx on port 443 forwards https://shop.example.com to 127.0.0.1:8080. # [1] version: "3.8" services: app: # [2] image: ghcr.io/example/shop:latest # [3] ports: - "127.0.0.1:8080:8080" # [4] environment: DB_HOST: db DB_USER: shop DB_PASSWORD: Welcome2026! # [5] restart: "no" db: # [6] image: mariadb:11.4 restart: unless-stopped environment: MARIADB_USER: shop MARIADB_PASSWORD: ${DB_PASSWORD} MARIADB_RANDOM_ROOT_PASSWORD: "1" # [7] ports: - "3306:3306" # [8] volumes: - db-data:/var/lib/mysql cache: # [9] image: redis:7.4 restart: unless-stopped admin: image: admin.example/dashboard:3.2 restart: unless-stopped # [10] ports: - "9000:9000" volumes: - /var/run/docker.sock:/var/run/docker.sock volumes: db-data: