Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
5173,
5432 // for postgres
5432, // for postgres
6543 // for postgres
],
// "shutdownAction": "none",
//
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
run: pnpm dlx prisma migrate deploy
env:
DATABASE_URL: ${{ secrets.PREVIEW_DATABASE_URL }}
DIRECT_URL: ${{ secrets.PREVIEW_DIRECT_URL }}

- name: Pull Vercel Environment Information
run: pnpm vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
Expand Down Expand Up @@ -140,6 +141,7 @@ jobs:
run: pnpm dlx prisma migrate deploy
env:
DATABASE_URL: ${{ secrets.PRODUCTION_DATABASE_URL }}
DIRECT_URL: ${{ secrets.PRODUCTION_DIRECT_URL }}

- name: Pull Vercel Environment Information
run: pnpm vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
Expand Down
7 changes: 4 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ services:
web:
build: .
ports:
- 5173:5173
- '5173:5173'
tty: true
volumes:
- .:/usr/src/app:cached
- ./node_modules:/usr/src/app/node_modules:cached
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://db_user:db_password@db:5432/test_db
- DATABASE_URL=postgresql://db_user:db_password@db:5432/test_db?pgbouncer=true&connection_limit=10&connect_timeout=60&statement_timeout=60000 # Note: Local server cannot start if port is set to db:6543.
- DIRECT_URL=postgresql://db_user:db_password@db:5432/test_db
command: sleep infinity
depends_on:
- db
Expand All @@ -25,7 +26,7 @@ services:
POSTGRES_DB: test_db
POSTGRES_INITDB_ARGS: '--encoding=UTF8'
ports:
- 5432:5432
- '6543:5432'

volumes:
postgres-data:
Expand Down
11 changes: 7 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

// See:
// https://www.prisma.io/docs/concepts/components/prisma-schema/generators
// https://www.prisma.io/docs/orm/prisma-client/deployment/edge/deploy-to-vercel
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-3.0.x"]
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-3.0.x"]
previewFeatures = ["driverAdapters"]
}

// See:
Expand All @@ -26,8 +28,9 @@ generator fabbrica {
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

// Note: Lucia v3 + v3 Prisma adaperでは、全てのフィールドがキャメルケースであることが要求されている。
Expand Down
Loading