0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

dockerでnginxをlocal storageで起動

Posted at

自分的メモ

とりあえず、気軽にWEBサーバーをローカルに立てたいが、インストールとか設定とか更新とか面倒なので、dockerで建てたnginxってローカルストレージのHTMLを表示してくれないかな?って調べたら結構簡単にできたのでそれのメモ

やり方

> cd ~/htdocs
> docker pull nginx:alpine
> docker run --name nginx -v ~/htdocs:/usr/share/nginx/html:ro -p 8080:80 -d nginx:alpine

これで、自分のHOMEディレクトリ配下のhtdocsに置いてあるファイルを http://127.0.0.1:8080 でアクセス出来るようになる

MDwikiのテストとかで使ってみると、サクッと動いた

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?