Created
March 26, 2021 07:15
-
-
Save suzukiken/a5f038d629f856b478c48b01176d2481 to your computer and use it in GitHub Desktop.
run webserver on cloud9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir html | |
cat >html/index.html <<-EOF | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
こんにちは | |
</body> | |
</html> | |
EOF | |
sudo docker run --name webserver -p 80:80 -v /home/ec2-user/environment/html:/usr/share/nginx/html:ro -d nginx | |
IPADDRESS=$(curl http://169.254.169.254/latest/meta-data/public-ipv4) | |
echo http://$IPADDRESS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment