Initial import
This commit is contained in:
commit
5a6b0c4903
|
@ -0,0 +1,4 @@
|
||||||
|
export SERVICE=${REPO_NAME_SNAKE}
|
||||||
|
export DOMAIN=${REPO_NAME_KEBAB}.example.com
|
||||||
|
export STACK_NAME=${REPO_NAME_SNAKE}
|
||||||
|
export LETS_ENCRYPT_ENV=production
|
|
@ -0,0 +1,2 @@
|
||||||
|
/README.md
|
||||||
|
/.envrc.sample
|
|
@ -0,0 +1 @@
|
||||||
|
/.envrc
|
|
@ -0,0 +1,17 @@
|
||||||
|
# ${REPO_NAME_TITLE}
|
||||||
|
|
||||||
|
${REPO_DESCRIPTION}
|
||||||
|
|
||||||
|
## Basic usage
|
||||||
|
|
||||||
|
1. Set up Docker Swarm and [`abra`]
|
||||||
|
2. Deploy [`compose-stacks/traefik`]
|
||||||
|
3. `git clone ${REPO_HTTPS_URL} && cd ${REPO_NAME}`
|
||||||
|
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
|
|
@ -0,0 +1,29 @@
|
||||||
|
---
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: nginx:1.19.2
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=proxy"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}.tls=true"
|
||||||
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 1m
|
||||||
|
|
||||||
|
networks:
|
||||||
|
proxy:
|
||||||
|
external: true
|
Loading…
Reference in New Issue