i am using supabase with nextjs app router. starting supabase locally uses 127.0.0.1
API URL: http://127.0.0.1:54321
GraphQL URL: http://127.0.0.1:54321/graphql/v1
S3 Storage URL: http://127.0.0.1:54321/storage/v1/s3
DB URL: postgresql://postgres:[email protected]:54322/postgres
Studio URL: http://127.0.0.1:54323
Inbucket URL: http://127.0.0.1:54324
so i set
“dev”: “next dev –hostname 127.0.0.1”,
at package.json. auth works and its all good.
Now the issue comes when i try learning docker
Dockerfile:
`FROM node:18-alpine AS base
FROM base AS dev
WORKDIR /app
# Install dependencies
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN
if [ -f yarn.lock ]; then yarn install;
elif [ -f package-lock.json ]; then npm install;
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm install;
else echo "Lockfile not found." && exit 1;
fi
# Copy the rest of the application code
COPY . .
# Expose the port Next.js is running on
EXPOSE 3000
# Start the Next.js development server
CMD ["npm", "run", "dev"]`
// docker-compose.yml
version: "3"
services:
open-math-prep-dev:
build:
context: ../../
dockerfile: docker/dev/Dockerfile
target: dev
image: open-math-prep-dev
ports:
- "3000:3000"
environment:
- WATCHPACK_POLLING=true
volumes:
- ../../:/app
- /app/node_modules
- /app/.next
When i spin up the container, i end up with zero error logs and just 127.0.0.1 didnt send any data. If i get rid of –hostname and change everything to use localhost, my google auth redirect ends up in Bad Request, because it takes me to 127.0.0.1:54321/auth/callback since that is the api url from npx supabase start
Thanks alot for any help!
set back localhost, set back 127.0.0.1