Skip to content

Commit 6f3c46f

Browse files
authored
fix: Change the healthcheck route for docker Studio (supabase#33180)
* Fix the healthcheck for the docker image for studio. * Various fixes related to the self-hosted environment.
1 parent 0437662 commit 6f3c46f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

apps/studio/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ COPY --from=builder /app/apps/studio/.next/standalone ./
5959
COPY --from=builder /app/apps/studio/.next/static ./apps/studio/.next/static
6060
EXPOSE 3000
6161
ENTRYPOINT ["docker-entrypoint.sh"]
62-
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD node -e "fetch('http://localhost:3000/api/profile').then((r) => {if (r.status !== 200) throw new Error(r.status)})"
62+
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD node -e "fetch('http://localhost:3000/api/platform/profile').then((r) => {if (r.status !== 200) throw new Error(r.status)})"
6363
CMD ["node", "apps/studio/server.js"]

apps/studio/pages/api/platform/auth/[ref]/users/[id]/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const handlePatch = async (req: NextApiRequest, res: NextApiResponse) => {
3232

3333
const handleDelete = async (req: NextApiRequest, res: NextApiResponse) => {
3434
const { id } = req.query
35-
const { error } = await supabase.auth.admin.deleteUser(id as string)
35+
const { data, error } = await supabase.auth.admin.deleteUser(id as string)
3636

3737
if (error) return res.status(400).json({ error: { message: error.message } })
38-
return res.status(200).send(undefined)
38+
return res.status(200).json(data)
3939
}

tests/local-studio-tests/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"scripts": {
77
"preinstall": "npx only-allow pnpm",
88
"env:setup": "supabase start -x studio && supabase status --output json > keys.json && node scripts/generate-env.js",
9-
"pretest": "pnpm run env:setup",
9+
"pretest": "pnpm env:setup",
1010
"test": "playwright test",
1111
"posttest": "supabase stop --no-backup",
12-
"codegen:setup": "pnpm run env:setup && NODE_ENV=test pnpm --prefix ../apps/studio run dev",
12+
"codegen:setup": "pnpm env:setup && NODE_ENV=test pnpm --prefix ../../apps/studio dev",
1313
"codegen": "playwright codegen http://localhost:8082/project/default",
1414
"clean": "rimraf node_modules"
1515
},

0 commit comments

Comments
 (0)