diff --git a/docker-compose.yaml b/docker-compose.yaml index 9cb634f74..8207b5157 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,5 @@ # Use postgres/example user/password credentials -version: '3.1' +version: '3.9' volumes: database-data: @@ -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: @@ -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.