refactor: update health check URL in Dockerfile and enhance database initialization script with new role grants and type creation
This commit is contained in:
+1
-1
@@ -56,7 +56,7 @@ ENV HOSTNAME="0.0.0.0"
|
||||
|
||||
# Health check for Dokploy / Coolify / Docker orchestrators
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
|
||||
CMD wget -qO- http://localhost:3000/api/health || exit 1
|
||||
CMD wget -qO- http://127.0.0.1:3000/api/health || exit 1
|
||||
|
||||
# Runtime env vars (Supabase keys, AI keys etc.) are injected by
|
||||
# Dokploy / Coolify as environment variables — no .env file needed.
|
||||
|
||||
@@ -16,6 +16,8 @@ grant all privileges on database postgres to supabase_storage_admin;
|
||||
create schema if not exists auth authorization supabase_auth_admin;
|
||||
create schema if not exists storage authorization supabase_storage_admin;
|
||||
|
||||
grant usage, create on schema public to supabase_auth_admin;
|
||||
grant usage, create on schema public to supabase_storage_admin;
|
||||
grant usage on schema public to anon, authenticated, service_role;
|
||||
grant usage on schema auth to supabase_auth_admin;
|
||||
grant usage on schema storage to anon, authenticated, service_role, supabase_storage_admin;
|
||||
@@ -24,29 +26,14 @@ create extension if not exists "uuid-ossp";
|
||||
create extension if not exists pgcrypto;
|
||||
create extension if not exists vector;
|
||||
|
||||
create or replace function auth.uid()
|
||||
returns uuid
|
||||
language sql
|
||||
stable
|
||||
as \$\$
|
||||
select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid;
|
||||
\$\$;
|
||||
|
||||
create or replace function auth.role()
|
||||
returns text
|
||||
language sql
|
||||
stable
|
||||
as \$\$
|
||||
select nullif(current_setting('request.jwt.claim.role', true), '')::text;
|
||||
\$\$;
|
||||
|
||||
create or replace function auth.email()
|
||||
returns text
|
||||
language sql
|
||||
stable
|
||||
as \$\$
|
||||
select nullif(current_setting('request.jwt.claim.email', true), '')::text;
|
||||
do \$\$
|
||||
begin
|
||||
create type auth.factor_type as enum ('totp', 'webauthn');
|
||||
exception
|
||||
when duplicate_object then null;
|
||||
end
|
||||
\$\$;
|
||||
alter type auth.factor_type owner to supabase_auth_admin;
|
||||
|
||||
alter default privileges in schema public grant select, insert, update, delete on tables to anon, authenticated, service_role;
|
||||
alter default privileges in schema public grant usage, select on sequences to anon, authenticated, service_role;
|
||||
|
||||
@@ -8,6 +8,6 @@ export async function proxy(request: NextRequest) {
|
||||
|
||||
export const config = {
|
||||
matcher: [
|
||||
'/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
||||
'/((?!api/health|_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user