Parcourir la source

add static site based on nginx

Guillaume Virlet il y a 6 ans
Parent
commit
0f88d1c919
2 fichiers modifiés avec 43 ajouts et 0 suppressions
  1. 24 0
      static/README.md
  2. 19 0
      static/docker-compose.yml

+ 24 - 0
static/README.md

@@ -0,0 +1,24 @@
+# Static site
+
+## Configure
+```
+export CHATONS_STATIC_SITE=changeme
+```
+
+## Deploy
+```
+docker-compose up -d
+```
+
+You just need to copy your static site content to:
+```
+/srv/chatons/static/changeme
+```
+
+Then ensure root is the owner of the files:
+```
+chown -R root:root /srv/chatons/static/changeme
+```
+
+Now you have a static site at URL `changeme.localhost`
+

+ 19 - 0
static/docker-compose.yml

@@ -0,0 +1,19 @@
+version: '3'
+
+networks:
+  web:
+    external: true
+
+services:
+  web:
+    image: nginx:alpine
+    restart: unless-stopped
+    volumes:
+      - ${CHATONS_ROOT_DIR:-/srv/chatons}/static/${CHATONS_STATIC_SITE:-static}:/usr/share/nginx/html:rw
+    labels:
+      traefik.enable: "true"
+      traefik.frontend.rule: "Host: ${CHATONS_STATIC_SITE:-static}.${CHATONS_DOMAIN:-localhost}, www.${CHATONS_STATIC_SITE:-static}.${CHATONS_DOMAIN:-localhost}"
+    networks:
+      - web
+      - default
+