Advertisement
pilasguru

docker-compose web with random background

Jun 16th, 2025
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.60 KB | Software | 0 0
  1. services:
  2.   web:
  3.     image: nginx:latest
  4.     ports:
  5.      - "8080:80"
  6.     command: >-
  7.       bash -c "COLORS=('red' 'green' 'blue' 'yellow' 'cyan' 'magenta' 'orange' 'purple' 'pink' 'lime' 'teal' 'brown' 'gold' 'navy' 'olive' 'maroon' 'aqua' 'coral' 'salmon' 'violet');
  8.      COLOR=$${COLORS[$$RANDOM % $${#COLORS[@]}]};
  9.      echo \"<html><body style='background: $$COLOR; color: #ffffff; display: flex; align-items: center; justify-content: center; height: 100vh; margin: 0; font-size: 24px;'><h1>Mi color de fondo es $$COLOR</h1></body></html>\" > /usr/share/nginx/html/index.html && nginx -g 'daemon off;'"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement