commit b6fcbc2829a202183da5e9026f0b0ad9273173da Author: 3wc <3wc@doesthisthing.work> Date: Sun Jul 11 00:12:19 2021 +0200 Initial import diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..37ec11e --- /dev/null +++ b/.env.sample @@ -0,0 +1,6 @@ +TYPE=capsul_flask + +DOMAIN=capsul_flask.example.com +## Domain aliases +#EXTRA_DOMAINS=', `www.capsul_flask.example.com`' +LETS_ENCRYPT_ENV=production diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37b52cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.envrc diff --git a/README.md b/README.md new file mode 100644 index 0000000..e698ce6 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# capsul-flask + +${REPO_DESCRIPTION} + + +* **Category**: +* **Status**: +* **Image**: [`capsul-flask`](https://hub.docker.com/r/capsul-flask/capsul-flask) +* **Healthcheck**: +* **Backups**: +* **Email**: +* **Tests**: +* **SSO**: + + +## Basic usage + +1. Set up Docker Swarm and [`abra`] +2. Deploy [`coop-cloud/traefik`] +3. `abra app new capsul-flask --secrets` (optionally with `--pass` if you'd like + to save secrets in `pass`) +4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to + your Docker swarm box +5. `abra app YOURAPPDOMAIN deploy` +6. Open the configured domain in your browser to finish set-up + +[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra +[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..740d2a3 --- /dev/null +++ b/compose.yml @@ -0,0 +1,47 @@ +--- +version: "3.8" + +services: + app: + image: 3wordchant/capsul-flask:latest + networks: + - proxy + - internal + environment: + - "POSTGRES_CONNECTION_PARAMETERS=host=db port=5432 user=capsul password=capsul dbname=capsul" + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=5000" + - "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", "wget", "--tries=1", "http://localhost:5000"] + interval: 30s + timeout: 10s + retries: 10 + start_period: 1m + + db: + image: "postgres:9.6.5" + networks: + - internal + volumes: + - "postgres:/var/lib/postgresql/data" + environment: + POSTGRES_USER: capsul + POSTGRES_PASSWORD: capsul + POSTGRES_DB: capsul + +networks: + proxy: + external: true + internal: + internal: true