Un mémo lorsque vous voulez faire nginx / Hello World avec Quick Docker
Hello World sur CloudRun et Fargate. .. ..
Structure du répertoire
.
├── Dockerfile
├── index.html
└── nginx.conf
Dockerfile
FROM nginx:latest
COPY ./index.html /usr/share/nginx/html
EXPOSE 80
nginx.conf
server {
listen 80;
server_name hello_nginx;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>nginx</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
#Construire
$ docker build --tag hello-nginx .
#Confirmation
$ docker images -a hello-nginx
#Commencez
$ docker run -d --name hello-nginx-container -p 80:80 hello-nginx
#Arrêtez
$ docker stop hello-nginx-container
#Supprimer
$ docker rm hello-nginx-container
Je l'oublie à chaque fois. .. ..
échantillon https://github.com/koffe0522/docker-nginx
Recommended Posts