From 4326bc0085faf78828fe4fc1c3578d7fdb895339 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Tue, 2 May 2023 00:00:28 +1000 Subject: [PATCH] Change index.html of nginx and serve it --- Dockerfile | 2 ++ README.md | 14 ++++++++++++++ docker-compose.yaml | 9 +++++++++ index.html | 13 +++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml create mode 100644 index.html diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..68269d7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:latest +COPY ./index.html /usr/share/nginx/html/index.html \ No newline at end of file diff --git a/README.md b/README.md index e69de29..1c81212 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,14 @@ +# README + +This is a practise repo for learning how to run nginx docker for serving: +* static content +* reverse proxy of other services + +How to run nginx docker container: + +``` +docker-compose build +docker-compose up +``` + +* As we use docker-compose.yaml, it's easy to build image and spawn up container \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..b4e394e --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +services: + web: + container_name: web + hostname: web + build: + context: ./ + dockerfile: Dockerfile + ports: + - 8085:80 \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..75997a0 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + Docker Nginx + + + +

Hello from Nginx container, Again

+ + + \ No newline at end of file