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

docker-compose.yaml: use profiles, container_names, unless-stopped, DATABASE_URL shortcut #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
31 changes: 18 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use postgres/example user/password credentials
version: '3.1'
version: '3.9'

volumes:
database-data:
Expand All @@ -11,12 +11,14 @@ networks:
services:
database:
image: postgres
restart: always
# profiles: ["withpostgres"] only starts when specifying this profile
container_name: calendso-db
restart: unless-stopped
volumes:
- database-data:/var/lib/postgresql/data/
env_file: .env
networks:
- stack
- calendso-stack

calendso:
build:
Expand All @@ -28,32 +30,35 @@ services:
- NEXT_PUBLIC_LICENSE_CONSENT=${NEXT_PUBLIC_LICENSE_CONSENT}
- NEXT_PUBLIC_TELEMETRY_KEY=${NEXT_PUBLIC_TELEMETRY_KEY}
image: calendso/calendso:latest
restart: always
container_name: calendso
restart: unless-stopped
networks:
- stack
- calendso-stack
ports:
- 3000:3000
env_file: .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
- DATABASE_URL=${DATABASE_URL}
depends_on:
- database
- database # comment out when using non-docker database (=enabled "withpostgres" profile)

# Optional use of Prisma Studio. In production, comment out or remove the section below to prevent unwanted access to your database.
# Optional use of Prisma Studio. To use *with* Prisma Studio:
# docker-compose --profile withstudio up
studio:
image: calendso/calendso:latest
restart: always
container_name: calendso-studio
restart: unless-stopped
profiles: ["withstudio"] # only starts when specifying this profile
networks:
- stack
- calendso-stack
ports:
- 5555:5555
env_file: .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
- DATABASE_URL=${DATABASE_URL}
depends_on:
- database
- database # comment out when using non-docker database (=enabled "withpostgres" profile)
command:
- npx
- prisma
- studio
# END SECTION: Optional use of Prisma Studio.