Skip to content

Commit

Permalink
fix url issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Nafeij committed Nov 9, 2023
1 parent c95ca8f commit f1506db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ RUN \
FROM node:18-alpine AS builder

# ARG DATABASE_URL

ARG NEXTAUTH_URL
ARG NEXT_PUBLIC_WS_PORT

WORKDIR /app
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ Notes:
- If postgres is running on 5432, kill the process `sudo pkill -u postgres`
- If you have trouble starting the `judge0` container, or encounter `Incorrect type. Expected "include".` in `compose.yml`, try updating `docker-compose` to `v2.20` (Docker Desktop `4.42.1`) or later.

## Building and Running Image

```bash
docker build -t peer-prep --build-arg NEXT_PUBLIC_WS_PORT=3002 .
docker run --env-file ./.env -e NODE_ENV=production -e PORT=3000 -p 3000:3000 peer-prep
```

## What's next? How do I make an app with this?

We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.
Expand Down
8 changes: 1 addition & 7 deletions src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ export const env = createEnv({
process.env.NODE_ENV === "production"
? z.string().min(1)
: z.string().min(1).optional(),
NEXTAUTH_URL: z.preprocess(
// This makes Vercel deployments not fail if you don't set NEXTAUTH_URL
// Since NextAuth.js automatically uses the VERCEL_URL if present.
(str) => process.env.VERCEL_URL ?? str,
// VERCEL_URL doesn't include `https` so it cant be validated as a URL
process.env.VERCEL ? z.string().min(1) : z.string().url(),
),
NEXTAUTH_URL: z.string().min(1),
S3_BUCKET_NAME: z.string().min(1),
// Add `.min(1) on ID and SECRET if you want to make sure they're not empty
GITHUB_ID: z.string().min(1),
Expand Down

0 comments on commit f1506db

Please sign in to comment.