+{% extends "layouts/base.html" %}
+
+
+{% block title %} AppFlowy Cloud Login {% endblock %}
+
+
+{% block head %}
+
+
+{% endblock %}
+
+
+{% block content %}
+
+
+
+ {% include "../assets/logo.html" %}
+
+
Welcome to AppFlowy
+
+
+
+ {% if oauth_providers.len() > 0 %}
+
+
+
+
+ {% for provider in oauth_providers %}
+
+ {% endfor %}
+
+
+
+
+ {% endif %}
+
+
 
+
 
+
 
+
+
+ {% endblock %}
+
+
diff --git a/docker/gotrue/Dockerfile b/docker/gotrue/Dockerfile
index 41aebd28..8eca287b 100644
--- a/docker/gotrue/Dockerfile
+++ b/docker/gotrue/Dockerfile
@@ -7,13 +7,14 @@ RUN git apply mfa_enabled.patch
RUN CGO_ENABLED=0 go build -o /auth .
RUN rm /go/src/supabase/auth/migrations/20240612123726_enable_rls_update_grants.up.sql
-FROM scratch
-COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo
-COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
-COPY --from=base /etc/passwd /etc/passwd
-COPY --from=base /etc/group /etc/group
+FROM alpine:3.20
+RUN adduser -D -u 1000 supabase
+
+RUN apk add --no-cache ca-certificates
+USER supabase
COPY --from=base /auth .
COPY --from=base /go/src/supabase/auth/migrations ./migrations
-CMD ["./auth"]
+COPY start.sh .
+CMD ["./start.sh"]
diff --git a/docker/gotrue/start.sh b/docker/gotrue/start.sh
new file mode 100755
index 00000000..3a1aaec6
--- /dev/null
+++ b/docker/gotrue/start.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env sh
+
+set -e
+./auth migrate
+if [ -n "${GOTRUE_ADMIN_EMAIL}" ] && [ -n "${GOTRUE_ADMIN_PASSWORD}" ]; then
+ set +e
+ echo "Creating admin user for gotrue..."
+ command_output=$(./auth admin createuser --admin "${GOTRUE_ADMIN_EMAIL}" "${GOTRUE_ADMIN_PASSWORD}" 2>&1)
+ command_status=$?
+ # Check if the command failed
+ if [ $command_status -ne 0 ]; then
+ # Check if the output contains the specific keyword
+ if echo "$command_output" | grep -q "user already exists"; then
+ echo "Admin user already exists. Skipping..."
+ else
+ echo "Command failed. Exiting."
+ echo $command_output
+ exit $command_status
+ fi
+ fi
+fi
+set -e
+./auth