feat: configure PostgreSQL database and fix TypeScript types
- Updated docker-compose.yml to use postgres:17-alpine - Database credentials: ogb/ogb_dev_password/ogb_web - Updated .env.example with correct PostgreSQL connection string - Fixed plugins/index.ts to include Project type in SEO generateTitle/generateURL - Changed site title from 'Payload Website Template' to 'OGB Solutions' - Database ready for dev server startup
This commit is contained in:
+1
-4
@@ -1,8 +1,5 @@
|
||||
# Database connection string
|
||||
DATABASE_URI=mongodb://127.0.0.1/your-database-name
|
||||
|
||||
# Or use a PG connection string
|
||||
#DATABASE_URI=postgresql://127.0.0.1:5432/your-database-name
|
||||
DATABASE_URI=postgres://ogb:ogb_dev_password@localhost:5432/ogb_web
|
||||
|
||||
# Used to encrypt JWT tokens
|
||||
PAYLOAD_SECRET=YOUR_SECRET_HERE
|
||||
|
||||
+10
-26
@@ -1,31 +1,15 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
payload:
|
||||
image: node:18-alpine
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
environment:
|
||||
POSTGRES_USER: ogb
|
||||
POSTGRES_PASSWORD: ogb_dev_password
|
||||
POSTGRES_DB: ogb_web
|
||||
ports:
|
||||
- '3000:3000'
|
||||
- '5432:5432'
|
||||
volumes:
|
||||
- .:/home/node/app
|
||||
- node_modules:/home/node/app/node_modules
|
||||
working_dir: /home/node/app/
|
||||
command: sh -c "yarn install && yarn dev"
|
||||
depends_on:
|
||||
- mongo
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
mongo:
|
||||
image: mongo:latest
|
||||
ports:
|
||||
- '27017:27017'
|
||||
command:
|
||||
- --storageEngine=wiredTiger
|
||||
volumes:
|
||||
- data:/data/db
|
||||
logging:
|
||||
driver: none
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
data:
|
||||
node_modules:
|
||||
postgres_data:
|
||||
|
||||
@@ -10,14 +10,15 @@ import { FixedToolbarFeature, HeadingFeature, lexicalEditor } from '@payloadcms/
|
||||
import { searchFields } from '@/search/fieldOverrides'
|
||||
import { beforeSyncWithSearch } from '@/search/beforeSync'
|
||||
|
||||
import { Page, Post } from '@/payload-types'
|
||||
import { Page, Post, Project } from '@/payload-types'
|
||||
import { getServerSideURL } from '@/utilities/getURL'
|
||||
|
||||
const generateTitle: GenerateTitle<Post | Page> = ({ doc }) => {
|
||||
return doc?.title ? `${doc.title} | Payload Website Template` : 'Payload Website Template'
|
||||
const generateTitle: GenerateTitle<Post | Page | Project> = ({ doc }) => {
|
||||
const title = doc?.title || (doc as Project)?.name
|
||||
return title ? `${title} | OGB Solutions` : 'OGB Solutions'
|
||||
}
|
||||
|
||||
const generateURL: GenerateURL<Post | Page> = ({ doc }) => {
|
||||
const generateURL: GenerateURL<Post | Page | Project> = ({ doc }) => {
|
||||
const url = getServerSideURL()
|
||||
|
||||
return doc?.slug ? `${url}/${doc.slug}` : url
|
||||
|
||||
Reference in New Issue
Block a user