From 52626765962fa5bbfc44a36b2b2bb287553bb400 Mon Sep 17 00:00:00 2001 From: marcomaiermm Date: Sat, 8 Jun 2024 10:45:34 +0200 Subject: [PATCH 1/2] feat: Add Supertokens template --- public/svgs/supertokens.svg | 17 +++++++++++++++ templates/compose/supertokens.yaml | 35 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 public/svgs/supertokens.svg create mode 100644 templates/compose/supertokens.yaml diff --git a/public/svgs/supertokens.svg b/public/svgs/supertokens.svg new file mode 100644 index 000000000..30b435bd0 --- /dev/null +++ b/public/svgs/supertokens.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/templates/compose/supertokens.yaml b/templates/compose/supertokens.yaml new file mode 100644 index 000000000..703cab780 --- /dev/null +++ b/templates/compose/supertokens.yaml @@ -0,0 +1,35 @@ +# documentation: https://supertokens.com/docs/guides +# logo: svgs/supertokens.svg +# slogan: An open-source authentication solution that simplifies the implementation of secure user authentication and session management for web and mobile applications. +# tags: supertokens,login,authentication,authorization,oauth,user-management,session-management,access-control,otp,magic-link,passwordless +# port: 3567 + +services: + supertokens: + image: registry.supertokens.io/supertokens/supertokens-postgresql + depends_on: + db: + condition: service_healthy + environment: + - SERVICE_FQDN_SUPERTOKENS_3567 + - POSTGRESQL_CONNECTION_URI="postgresql://$SERVICE_USER_POSTGRESQL:$SERVICE_PASSWORD_POSTGRESQL@db:5432/${POSTGRES_DB:-supertokens}" + restart: unless-stopped + healthcheck: + test: "bash -c 'exec 3<>/dev/tcp/127.0.0.1/3567 && echo -e \"GET /hello HTTP/1.1\\r\\nhost: 127.0.0.1:3567\\r\\nConnection: close\\r\\n\\r\\n\" >&3 && cat <&3 | grep \"Hello\"'\n" + interval: 10s + timeout: 5s + retries: 5 + db: + image: postgres:16 + environment: + - POSTGRES_USER=$SERVICE_USER_POSTGRESQL + - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRESQL + - POSTGRES_DB=${POSTGRES_DB:-supertokens} + volumes: + - supertokens-postgres-data:/var/lib/postgresql/data + restart: unless-stopped + healthcheck: + test: ["CMD", "pg_isready", "-U", "$SERVICE_USER_POSTGRESQL", "-d", "${POSTGRES_DB:-supertokens}"] + interval: 5s + timeout: 5s + retries: 5 From 7d1f760c532c769c4bb525c97d299adb2bb2d14d Mon Sep 17 00:00:00 2001 From: marcomaiermm Date: Sat, 8 Jun 2024 11:23:11 +0200 Subject: [PATCH 2/2] add optional api key --- templates/compose/supertokens.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/compose/supertokens.yaml b/templates/compose/supertokens.yaml index 703cab780..f6ab90c5f 100644 --- a/templates/compose/supertokens.yaml +++ b/templates/compose/supertokens.yaml @@ -12,6 +12,7 @@ services: condition: service_healthy environment: - SERVICE_FQDN_SUPERTOKENS_3567 + - API_KEYS=${API_KEYS:-} - POSTGRESQL_CONNECTION_URI="postgresql://$SERVICE_USER_POSTGRESQL:$SERVICE_PASSWORD_POSTGRESQL@db:5432/${POSTGRES_DB:-supertokens}" restart: unless-stopped healthcheck: