diff --git a/apps/docs/src/content/recipes/drizzle.mdx b/apps/docs/src/content/recipes/drizzle.mdx index 372b6643..65b95ef1 100644 --- a/apps/docs/src/content/recipes/drizzle.mdx +++ b/apps/docs/src/content/recipes/drizzle.mdx @@ -15,7 +15,7 @@ pnpm add -D drizzle-kit @types/pg Create a `.env` file in the root of your project and add the following: ```properties -DATABASE_URL="postgres://postgres:postgres@localhost:5432/database-name" +DATABASE_URL="postgres://postgres:postgres@localhost:5432/" ``` ## 3. Folder Structure @@ -51,6 +51,10 @@ DATABASE_URL="postgres://postgres:postgres@localhost:5432/database-name" } ] }, + { + id: 'docker-compose', + name: 'docker-compose.yml' + }, { id: 'drizzle-config', name: 'drizzle.config.ts' @@ -94,7 +98,32 @@ export default { } satisfies Config ``` -## 4. Apply Migrations +```yml title='docker-compose.yml' +version: '3' + +services: + db: + image: postgres:16-alpine + container_name: _postgres + ports: + - 5432:5432 + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB= +``` + + + Remember to replace `` with the name of your project. + + +## 4. Start Database + +```bash +docker compose up -d +``` + +## 5. Apply Migrations ```bash pnpm db:generate