Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support for local development with dev server and volume binding #71

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ services:
env_file: .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
- NODE_ENV=development
depends_on:
- database
volumes:
- "./calendso:/app/"
- "./scripts:/app/scripts"

# Optional use of Prisma Studio. In production, comment out or remove the section below to prevent unwanted access to your database.
studio:
Expand Down
12 changes: 10 additions & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/sh
#!/bin/bash
set -x

# # Set environment variables
# echo NEXT_PUBLIC_APP_URL $NEXT_PUBLIC_APP_URL
# find \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s#$NEXT_PUBLIC_APP_URL#$NEXT_PUBLIC_APP_URL_SUBSTITUTE#g"

/app/scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up"
npx prisma migrate deploy
yarn start
if [[ $NODE_ENV == "development" ]]; then
yarn dev
else
yarn start
fi