Skip to content

Commit

Permalink
Make use of internal docker networks unifi database name
Browse files Browse the repository at this point in the history
  • Loading branch information
flemming-pr committed Dec 15, 2021
1 parent 50f472c commit 6c7ebb3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Set this value to 'agree' to accept our license:
# Set this value to 'agree' to accept our license:
# LICENSE: https://github.com/calendso/calendso/blob/main/LICENSE
#
# Summary of terms:
Expand All @@ -14,7 +14,7 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
POSTGRES_USER=unicorn_user
POSTGRES_PASSWORD=magical_password
POSTGRES_DB=calendso
DATABASE_HOST=db:5432
DATABASE_HOST=database:5432
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
GOOGLE_API_CREDENTIALS={}

Expand Down
26 changes: 19 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Use postgres/example user/password credentials
version: '3.1'

volumes:
database-data:

networks:
stack:
external: false

services:
db:
database:
image: postgres
restart: always
volumes:
- database-data:/var/lib/postgresql/data/
env_file: .env
ports:
- 5432:5432
networks:
- stack

calendso:
build:
context: .
Expand All @@ -18,28 +27,31 @@ services:
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
image: calendso/docker
restart: always
networks:
- stack
ports:
- 3000:3000
env_file: .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
depends_on:
- db
- database

# Optional use of Prisma Studio. In production, comment out or remove the section below to prevent unwanted access to your database.
studio:
image: calendso/docker
restart: always
networks:
- stack
ports:
- 5555:5555
env_file: .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
depends_on:
- db
- database
command:
- npx
- prisma
- studio
# END SECTION: Optional use of Prisma Studio.
volumes:
database-data:
2 changes: 1 addition & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
set -x

/app/scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "db is up"
/app/scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up"
npx prisma migrate deploy
yarn start

0 comments on commit 6c7ebb3

Please sign in to comment.