changed docker compose to use postgres

This commit is contained in:
2025-10-08 14:26:30 -04:00
parent b018742ebc
commit 343889da93
2 changed files with 33 additions and 43 deletions

View File

@@ -1,43 +1,33 @@
version: '3'
services: services:
payload: # payload:
image: node:18-alpine # image: node:18-alpine
ports: # ports:
- '3000:3000' # - '3000:3000'
volumes: # volumes:
- .:/home/node/app # - .:/home/node/app
- node_modules:/home/node/app/node_modules # - node_modules:/home/node/app/node_modules
working_dir: /home/node/app/ # working_dir: /home/node/app/
command: sh -c "corepack enable && corepack prepare pnpm@latest --activate && pnpm install && pnpm dev" # command: sh -c "yarn install && yarn dev"
depends_on: # depends_on:
- mongo
# - postgres # - postgres
# env_file:
# - .env
postgres:
image: postgres:15
container_name: payloadcms_postgres
restart: unless-stopped
ports:
- "5432:5432"
environment:
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
env_file: env_file:
- .env - .env
# Ensure your DATABASE_URI uses 'mongo' as the hostname ie. mongodb://mongo/my-db-name
mongo:
image: mongo:latest
ports:
- '27017:27017'
command:
- --storageEngine=wiredTiger
volumes: volumes:
- data:/data/db - data:/data/db
logging:
driver: none
# Uncomment the following to use postgres
# postgres:
# restart: always
# image: postgres:latest
# volumes:
# - pgdata:/var/lib/postgresql/data
# ports:
# - "5432:5432"
volumes: volumes:
data: data:
# pgdata:
node_modules: node_modules:

View File

@@ -82,7 +82,7 @@ export interface Config {
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>; 'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
}; };
db: { db: {
defaultIDType: string; defaultIDType: number;
}; };
globals: {}; globals: {};
globalsSelect: {}; globalsSelect: {};
@@ -118,7 +118,7 @@ export interface UserAuthOperations {
* via the `definition` "users". * via the `definition` "users".
*/ */
export interface User { export interface User {
id: string; id: number;
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
email: string; email: string;
@@ -142,7 +142,7 @@ export interface User {
* via the `definition` "media". * via the `definition` "media".
*/ */
export interface Media { export interface Media {
id: string; id: number;
alt: string; alt: string;
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
@@ -161,20 +161,20 @@ export interface Media {
* via the `definition` "payload-locked-documents". * via the `definition` "payload-locked-documents".
*/ */
export interface PayloadLockedDocument { export interface PayloadLockedDocument {
id: string; id: number;
document?: document?:
| ({ | ({
relationTo: 'users'; relationTo: 'users';
value: string | User; value: number | User;
} | null) } | null)
| ({ | ({
relationTo: 'media'; relationTo: 'media';
value: string | Media; value: number | Media;
} | null); } | null);
globalSlug?: string | null; globalSlug?: string | null;
user: { user: {
relationTo: 'users'; relationTo: 'users';
value: string | User; value: number | User;
}; };
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
@@ -184,10 +184,10 @@ export interface PayloadLockedDocument {
* via the `definition` "payload-preferences". * via the `definition` "payload-preferences".
*/ */
export interface PayloadPreference { export interface PayloadPreference {
id: string; id: number;
user: { user: {
relationTo: 'users'; relationTo: 'users';
value: string | User; value: number | User;
}; };
key?: string | null; key?: string | null;
value?: value?:
@@ -207,7 +207,7 @@ export interface PayloadPreference {
* via the `definition` "payload-migrations". * via the `definition` "payload-migrations".
*/ */
export interface PayloadMigration { export interface PayloadMigration {
id: string; id: number;
name?: string | null; name?: string | null;
batch?: number | null; batch?: number | null;
updatedAt: string; updatedAt: string;