From 630deefa729e68131783ae004d3452d2498e4fec Mon Sep 17 00:00:00 2001 From: Christian Lempa Date: Wed, 24 Apr 2024 17:06:49 +0200 Subject: [PATCH 1/5] add docker compose for nginx --- docker-compose/nginx/docker-compose.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docker-compose/nginx/docker-compose.yaml diff --git a/docker-compose/nginx/docker-compose.yaml b/docker-compose/nginx/docker-compose.yaml new file mode 100644 index 0000000..a5c35aa --- /dev/null +++ b/docker-compose/nginx/docker-compose.yaml @@ -0,0 +1,13 @@ +--- +services: + nginx: + image: nginx:1.25.5-alpine + container_name: nginx + ports: + - 80:80 + - 443:443 + volumes: + - ./config/nginx.conf:/etc/nginx/nginx.conf + - ./certs:/etc/nginx/certs + - ./data:/usr/share/nginx/html + restart: unless-stopped From fd80043041c9fe5da1acbc2b0704f3c6cee8d6f8 Mon Sep 17 00:00:00 2001 From: Christian Lempa Date: Wed, 24 Apr 2024 17:40:07 +0200 Subject: [PATCH 2/5] updated minimal nginx config --- docker-compose/nginx/config/nginx.conf | 14 ++++++++++++++ docker-compose/nginx/data/index.html | 1 + docker-compose/nginx/docker-compose.yaml | 3 +-- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 docker-compose/nginx/config/nginx.conf create mode 100644 docker-compose/nginx/data/index.html diff --git a/docker-compose/nginx/config/nginx.conf b/docker-compose/nginx/config/nginx.conf new file mode 100644 index 0000000..6b49c69 --- /dev/null +++ b/docker-compose/nginx/config/nginx.conf @@ -0,0 +1,14 @@ +events { + worker_connections 1024; +} + +http { + server { + listen 80; + server_name _; + location / { + root /usr/share/nginx/html; + index index.html; + } + } +} diff --git a/docker-compose/nginx/data/index.html b/docker-compose/nginx/data/index.html new file mode 100644 index 0000000..7a4b3a6 --- /dev/null +++ b/docker-compose/nginx/data/index.html @@ -0,0 +1 @@ +this is a test website... diff --git a/docker-compose/nginx/docker-compose.yaml b/docker-compose/nginx/docker-compose.yaml index a5c35aa..863f742 100644 --- a/docker-compose/nginx/docker-compose.yaml +++ b/docker-compose/nginx/docker-compose.yaml @@ -7,7 +7,6 @@ services: - 80:80 - 443:443 volumes: - - ./config/nginx.conf:/etc/nginx/nginx.conf - - ./certs:/etc/nginx/certs + - ./config:/etc/nginx - ./data:/usr/share/nginx/html restart: unless-stopped From 68d5a442d517a905f116d7f852047b1fde109f65 Mon Sep 17 00:00:00 2001 From: Christian Lempa Date: Wed, 24 Apr 2024 17:46:23 +0200 Subject: [PATCH 3/5] change config to be simplified --- docker-compose/nginx/config/default.conf | 8 ++++++++ docker-compose/nginx/config/nginx.conf | 14 -------------- docker-compose/nginx/docker-compose.yaml | 4 ++-- 3 files changed, 10 insertions(+), 16 deletions(-) create mode 100644 docker-compose/nginx/config/default.conf delete mode 100644 docker-compose/nginx/config/nginx.conf diff --git a/docker-compose/nginx/config/default.conf b/docker-compose/nginx/config/default.conf new file mode 100644 index 0000000..2266fd5 --- /dev/null +++ b/docker-compose/nginx/config/default.conf @@ -0,0 +1,8 @@ +server { + listen 80; + server_name _; + location / { + root /usr/share/nginx/html; + index index.html; + } +} diff --git a/docker-compose/nginx/config/nginx.conf b/docker-compose/nginx/config/nginx.conf deleted file mode 100644 index 6b49c69..0000000 --- a/docker-compose/nginx/config/nginx.conf +++ /dev/null @@ -1,14 +0,0 @@ -events { - worker_connections 1024; -} - -http { - server { - listen 80; - server_name _; - location / { - root /usr/share/nginx/html; - index index.html; - } - } -} diff --git a/docker-compose/nginx/docker-compose.yaml b/docker-compose/nginx/docker-compose.yaml index 863f742..cff1ed3 100644 --- a/docker-compose/nginx/docker-compose.yaml +++ b/docker-compose/nginx/docker-compose.yaml @@ -7,6 +7,6 @@ services: - 80:80 - 443:443 volumes: - - ./config:/etc/nginx - - ./data:/usr/share/nginx/html + - ./config/default.conf:/etc/nginx/conf.d/default.conf:ro + - ./data:/usr/share/nginx/html:ro restart: unless-stopped From 19c91ca4591e59f7b164d69f5ff4f04a9eb12669 Mon Sep 17 00:00:00 2001 From: Christoph Schug Date: Thu, 25 Apr 2024 12:36:23 +0200 Subject: [PATCH 4/5] chore(deps): update docker.io/library/nginx docker tag to 1.26.0-alpine --- docker-compose/nginx/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/nginx/docker-compose.yaml b/docker-compose/nginx/docker-compose.yaml index cff1ed3..58922ab 100644 --- a/docker-compose/nginx/docker-compose.yaml +++ b/docker-compose/nginx/docker-compose.yaml @@ -1,7 +1,7 @@ --- services: nginx: - image: nginx:1.25.5-alpine + image: docker.io/library/nginx:1.26.0-alpine container_name: nginx ports: - 80:80 From 7c049d8aeab07a0ca8862ff0f73fcc38444d22e6 Mon Sep 17 00:00:00 2001 From: Christian Lempa Date: Fri, 26 Apr 2024 15:33:47 +0200 Subject: [PATCH 5/5] fixes --- docker-compose/nginx/config/default.conf | 8 ++++---- docker-compose/nginx/docker-compose.yaml | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docker-compose/nginx/config/default.conf b/docker-compose/nginx/config/default.conf index 2266fd5..a2f1d40 100644 --- a/docker-compose/nginx/config/default.conf +++ b/docker-compose/nginx/config/default.conf @@ -1,8 +1,8 @@ server { listen 80; server_name _; - location / { - root /usr/share/nginx/html; - index index.html; - } + location / { + root /usr/share/nginx/html; + index index.html; + } } diff --git a/docker-compose/nginx/docker-compose.yaml b/docker-compose/nginx/docker-compose.yaml index 58922ab..8a8d84e 100644 --- a/docker-compose/nginx/docker-compose.yaml +++ b/docker-compose/nginx/docker-compose.yaml @@ -5,7 +5,8 @@ services: container_name: nginx ports: - 80:80 - - 443:443 + # (optional) uncomment the line below to enable HTTPS + # - 443:443 volumes: - ./config/default.conf:/etc/nginx/conf.d/default.conf:ro - ./data:/usr/share/nginx/html:ro