-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix production build broken by missing env DATABASE_URL at build time
We moved DB initialization to core: #34 This breaks production build because at build time DATABASE_URL is not and should never be defined
- Loading branch information
1 parent
1ad82ea
commit 5dce8ba
Showing
7 changed files
with
68 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
.pnpm-store | ||
out | ||
dist | ||
*.md | ||
.git | ||
.next | ||
!.next/static | ||
!.next/standalone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { createEnv } from '@t3-oss/env-core' | ||
import z from 'zod' | ||
|
||
import '@latitude-data/env' | ||
|
||
const envvars = z.object({ | ||
NODE_ENV: z.string(), | ||
DATABASE_URL: z.string(), | ||
export default createEnv({ | ||
skipValidation: process.env.BUILDING_CONTAINER == 'true', | ||
server: { | ||
NODE_ENV: z.string(), | ||
DATABASE_URL: z.string().url(), | ||
}, | ||
runtimeEnv: process.env, | ||
}) | ||
|
||
export default envvars.parse(process.env) | ||
|
||
declare global { | ||
namespace NodeJS { | ||
interface ProcessEnv extends z.infer<typeof envvars> {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.