Ver código fonte

new template

Christian Lempa 1 ano atrás
pai
commit
9d65392432

+ 14 - 26
docker-compose/nginx/compose.yaml

@@ -4,35 +4,23 @@ services:
     image: docker.io/library/nginx:1.26.3-alpine
     container_name: nginx
     ports:
-      # --> (Optional) Remove when using traefik...
       - 80:80
-      - 443:443  # <-- (Optional) Remove to disable HTTPS
-      # <--
+      - 443:443
     volumes:
       - ./config/default.conf:/etc/nginx/conf.d/default.conf:ro
       - ./data:/usr/share/nginx/html:ro
-      # --> (Example) Add additional servers for different domains
-      # - ./config/your-local-service.conf:/etc/nginx/conf.d/your-local-service.conf:ro
-      # - ./data-2:/usr/share/nginx/html-2:ro
-      # <--
-    # --> (Optional) When using traefik...
-    # labels:
-    #   - traefik.enable=true
-    #   # -- Traefik Services
-    #   - traefik.http.services.nginx.loadbalancer.server.port=80
-    #   # -- Traefik Routers
-    #   - traefik.http.routers.nginx.entrypoints=websecure
-    #   - traefik.http.routers.nginx.rule=Host(`your-web-site-fqdn`)
-    #   - traefik.http.routers.nginx.tls=true
-    #   - traefik.http.routers.nginx.tls.certresolver=cloudflare
-    #   - traefik.http.routers.nginx.service=nginx
-    # networks:
-    #   - frontend
-    # <--
+    labels:
+      - traefik.enable=true
+      - traefik.http.services.nginx.loadbalancer.server.port=80
+      - traefik.http.routers.nginx.entrypoints=websecure
+      - traefik.http.routers.nginx.rule=Host(`example.com`)
+      - traefik.http.routers.nginx.tls=true
+      - traefik.http.routers.nginx.tls.certresolver=cloudflare
+      - traefik.http.routers.nginx.service=nginx
+    networks:
+      - frontend
     restart: unless-stopped
 
-# --> (Optional) When using traefik...
-# networks:
-#   frontend:
-#     external: true
-# <--
+networks:
+  frontend:
+    external: true

+ 1 - 0
docker-compose/nginx/config/default.conf

@@ -4,5 +4,6 @@ server {
   location / {
     root /usr/share/nginx/html;
     index index.html;
+    access_log on;
   }
 }

+ 0 - 11
docker-compose/nginx/config/example.server.conf

@@ -1,11 +0,0 @@
-# --> (Example) Add additional servers for different domains
-# server {
-#   listen 80;
-#   server_name  your-domain;  # <-- Change this to your domain
-#   location / {
-#     root /usr/share/nginx/html-2;
-#     index index.html;
-#     access_log on;  # <-- (Optional) Change to `off` to disable access log
-#   }
-# }
-# <--