fix(docker): add credentials fields to auth provider, postgres service, expose port 5433, AUTH_URL/AUTH_TRUST_HOST in env example
This commit is contained in:
@@ -18,3 +18,4 @@ OPENAI_API_KEY=sk-your-openai-key
|
||||
|
||||
# Application
|
||||
APP_BASE_URL=https://yourdomain.com
|
||||
AUTH_TRUST_HOST=true
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Stage 1: Install production dependencies
|
||||
# Stage 1: Install all dependencies (including devDeps needed for build)
|
||||
FROM --platform=linux/amd64 node:20-slim AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev
|
||||
RUN npm ci
|
||||
|
||||
# Stage 2: Build the application
|
||||
FROM --platform=linux/amd64 node:20-slim AS builder
|
||||
|
||||
@@ -1,11 +1,28 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5433:5432"
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: teressa
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3001:3000"
|
||||
env_file:
|
||||
- .env.production
|
||||
environment:
|
||||
@@ -15,6 +32,10 @@ services:
|
||||
- 1.1.1.1
|
||||
volumes:
|
||||
- uploads:/app/uploads
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
uploads:
|
||||
pgdata:
|
||||
|
||||
@@ -16,6 +16,10 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
|
||||
...authConfig,
|
||||
providers: [
|
||||
Credentials({
|
||||
credentials: {
|
||||
email: { label: "Email", type: "email" },
|
||||
password: { label: "Password", type: "password" },
|
||||
},
|
||||
async authorize(credentials) {
|
||||
const parsed = loginSchema.safeParse(credentials);
|
||||
if (!parsed.success) return null;
|
||||
|
||||
Reference in New Issue
Block a user