Nginx >
mkdir -p test_nginx/www cd test_nginx
./default.conf
server { listen 80; server_name localhost; root /var/www; index index.html index.htm; }
./docker-compose.yml
webserver: image: nginx volumes: - ./default.conf:/tmp/default.conf - ./www:/var/www ports: - "8080:80" command: /bin/sh -c "cat /tmp/default.conf >/etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
./www/index.html
<!doctype html> <html lang="ja"> <head> <meta charset="utf-8"> </head> <body> Test Nginx! </body> </html>
docker-compose up