From 1027655201e764e432d2cdcc031a5478cd191712 Mon Sep 17 00:00:00 2001 From: thopic Date: Mon, 17 Jan 2022 10:01:48 +0100 Subject: [PATCH] Add docs service --- nginxs/docs/.env.example | 2 ++ nginxs/docs/Dockerfile | 6 ++++++ nginxs/docs/docker-compose.yml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 nginxs/docs/.env.example create mode 100644 nginxs/docs/Dockerfile create mode 100644 nginxs/docs/docker-compose.yml diff --git a/nginxs/docs/.env.example b/nginxs/docs/.env.example new file mode 100644 index 0000000..98fdfde --- /dev/null +++ b/nginxs/docs/.env.example @@ -0,0 +1,2 @@ +DATA_PATH= +CN= diff --git a/nginxs/docs/Dockerfile b/nginxs/docs/Dockerfile new file mode 100644 index 0000000..a21c6ec --- /dev/null +++ b/nginxs/docs/Dockerfile @@ -0,0 +1,6 @@ +from nginx:1.21.4-alpine + +RUN sed -i "/http {/a\ \ \ \ server_tokens off;" /etc/nginx/nginx.conf \ + && sed -i "s/remote_addr/http_x_forwarded_for/g" /etc/nginx/nginx.conf + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginxs/docs/docker-compose.yml b/nginxs/docs/docker-compose.yml new file mode 100644 index 0000000..d235c66 --- /dev/null +++ b/nginxs/docs/docker-compose.yml @@ -0,0 +1,30 @@ +version: "3.8" + +services: + web: + build: . + image: my_nginx:1.21.4 + networks: + - proxy + expose: + - "80" + restart: unless-stopped + volumes: + - ${DATA_PATH}/html/:/usr/share/nginx/html:ro + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.docs-redirect-websecure.redirectscheme.scheme=https" + - "traefik.http.routers.docs-http.middlewares=docs-redirect-websecure" + - "traefik.http.routers.docs-http.rule=Host(`${CN}`)" + - "traefik.http.routers.docs-http.entrypoints=web" + - "traefik.http.routers.docs-https.rule=Host(`${CN}`)" + - "traefik.http.routers.docs-https.entrypoints=websecure" + - "traefik.http.routers.docs-https.tls=true" + - "traefik.http.routers.docs-https.tls.certresolver=myhttpchallenge" + - "co.elastic.logs/module=nginx" + +networks: + proxy: + external: true