Initial commit

This commit is contained in:
Compose Stacks 2020-10-06 20:48:21 +02:00
commit 485585483d
5 changed files with 75 additions and 0 deletions

19
.drone.yml Normal file
View File

@ -0,0 +1,19 @@
---
kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: decentral1se/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: custom_html
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
environment:
DOMAIN: custom-html.swarm-test.autonomic.zone
STACK_NAME: custom_html
LETS_ENCRYPT_ENV: production
trigger:
branch:
- main

7
.envrc.sample Normal file
View File

@ -0,0 +1,7 @@
export SERVICE=custom-html
export STACK_NAME=custom_html
export DOMAIN=custom-html.example.com
## Domain aliases
#export EXTRA_DOMAINS=', `www.custom-html.example.com`'
export LETS_ENCRYPT_ENV=production

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.envrc

17
README.md Normal file
View File

@ -0,0 +1,17 @@
# Custom-Html
Custom HTML website, served using Nginx
## Basic usage
1. Set up Docker Swarm and [`abra`]
2. Deploy [`compose-stacks/traefik`]
3. `git clone https://git.autonomic.zone/compose-stacks/custom-html.git && cd custom-html`
3. `cp .envrc.sample .envrc`
4. Edit `.envrc` - be sure to change `DOMAIN` to something that resolves to
your Docker swarm box
5. `direnv allow` (or `. .envrc`)
6. `abra deploy`
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
[`compose-stacks/traefik`]: https://git.autonomic.zone/compose-stacks/traefik

31
compose.yml Normal file
View File

@ -0,0 +1,31 @@
---
version: "3.8"
services:
app:
image: nginx:1.19.2
networks:
- proxy
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
## Redirect from EXTRA_DOMAINS to DOMAIN
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
networks:
proxy:
external: true