Skip to content

Commit 8c503bc

Browse files
committed
Feat: Supertokens
1 parent c4ee919 commit 8c503bc

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
services:
2+
supertokens:
3+
image: 'registry.supertokens.io/supertokens/supertokens-mysql:latest'
4+
depends_on:
5+
mysql:
6+
condition: service_healthy
7+
environment:
8+
- SERVICE_FQDN_SUPERTOKENS_3567
9+
- API_KEYS=${API_KEYS:-}
10+
- MYSQL_CONNECTION_URI=mysql://$SERVICE_USER_MYSQL:$SERVICE_PASSWORD_MYSQL@mysql:3306/${MYSQL_DATABASE:-supertokens}
11+
healthcheck:
12+
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"
13+
interval: 10s
14+
timeout: 5s
15+
retries: 5
16+
17+
mysql:
18+
image: 'mysql:latest'
19+
environment:
20+
- MYSQL_ROOT_PASSWORD=$SERVICE_PASSWORD_MYSQL
21+
- MYSQL_USER=$SERVICE_USER_MYSQL
22+
- MYSQL_PASSWORD=$SERVICE_PASSWORD_MYSQL
23+
- MYSQL_DATABASE=${MYSQL_DATABASE:-supertokens}
24+
volumes:
25+
- 'supertokens-mysql-data:/var/lib/mysql'
26+
healthcheck:
27+
test:
28+
- CMD
29+
- mysqladmin
30+
- ping
31+
- '-h'
32+
- localhost
33+
timeout: 20s
34+
retries: 10
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# documentation: https://supertokens.com/docs/guides
2+
# slogan: An open-source authentication solution that simplifies the implementation of secure user authentication and session management for web and mobile applications.
3+
# tags: supertokens,login,authentication,authorization,oauth,user-management,session-management,access-control,otp,magic-link,passwordless
4+
# logo: svgs/supertokens.svg
5+
# port: 3567
6+
7+
services:
8+
supertokens:
9+
image: registry.supertokens.io/supertokens/supertokens-postgresql:latest
10+
depends_on:
11+
postgres:
12+
condition: service_healthy
13+
environment:
14+
- SERVICE_FQDN_SUPERTOKENS_3567
15+
- API_KEYS=${API_KEYS:-}
16+
- POSTGRESQL_CONNECTION_URI="postgresql://$SERVICE_USER_POSTGRESQL:$SERVICE_PASSWORD_POSTGRESQL@postgres:5432/${POSTGRES_DB:-supertokens}"
17+
healthcheck:
18+
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"
19+
interval: 10s
20+
timeout: 5s
21+
retries: 5
22+
postgres:
23+
image: postgres:16
24+
environment:
25+
- POSTGRES_USER=$SERVICE_USER_POSTGRESQL
26+
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRESQL
27+
- POSTGRES_DB=${POSTGRES_DB:-supertokens}
28+
volumes:
29+
- supertokens-postgres-data:/var/lib/postgresql/data
30+
healthcheck:
31+
test: ["CMD", "pg_isready", "-U", "$SERVICE_USER_POSTGRESQL", "-d", "${POSTGRES_DB:-supertokens}"]
32+
interval: 5s
33+
timeout: 5s
34+
retries: 5

0 commit comments

Comments
 (0)