1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 14:59:36 +02:00

Add ORIGIN environment variable and update startup script

This commit is contained in:
Sean Morley 2024-04-10 13:30:54 +00:00
parent 40f8c72f19
commit 4c032445a7
3 changed files with 5 additions and 1 deletions

View file

@ -5,6 +5,8 @@ services:
- "3000:3000" - "3000:3000"
environment: environment:
- DATABASE_URL=postgres://adventurelog:PO24VjITwGgk@db:5432/adventurelog - DATABASE_URL=postgres://adventurelog:PO24VjITwGgk@db:5432/adventurelog
# ORIGIN is only necessary when not using a reverse proxy or hosting that includes https
- ORIGIN=http://localhost:3000
depends_on: depends_on:
- db - db
db: db:

View file

@ -23,5 +23,6 @@ npm run generate
# Run database migration # Run database migration
npm run migrate npm run migrate
echo "The orgin to be set is: $ORIGIN"
# Start the application # Start the application
node build/index.js ORIGIN=$ORIGIN node build

View file

@ -14,6 +14,7 @@ const config = {
preprocess: vitePreprocess(), preprocess: vitePreprocess(),
kit: { kit: {
adapter: adapter(), adapter: adapter(),
csrf: { checkOrigin: true, }
}, },
}; };