Files
payloadcms/templates/with-vercel-postgres/docker-compose.yml
Patrik 5d7be15c52 templates: update docker-compose to use postgres by default in postgres specific templates (#11328)
### What?

Updated `docker-compose.yml` to use `Postgres` by default, with
`MongoDB` commented out in the templates that are by default using the
postgres adapter.

Fixes #11322
2025-02-21 13:15:54 -05:00

48 lines
1.1 KiB
YAML

version: '3'
services:
payload:
image: node:20-alpine
ports:
- '3000:3000'
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
working_dir: /home/node/app/
command: sh -c "corepack enable && corepack prepare pnpm@9.0.0 --activate && pnpm install && pnpm dev"
depends_on:
- postgres
# - mongo
env_file:
- .env
# Ensure your DATABASE_URI uses 'postgresql' as the hostname ie. postgresql://127.0.0.1:5432/your-database-name
postgres:
restart: always
image: postgres:latest
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- '5432:5432'
environment:
POSTGRES_USER: postgres
POSTGRES_DB: your-database-name # THIS MUST MATCH YOUR DB NAME IN .env
POSTGRES_HOST_AUTH_METHOD: trust
# Uncomment the following to use mongodb
# mongo:
# image: mongo:latest
# ports:
# - '27017:27017'
# command:
# - --storageEngine=wiredTiger
# volumes:
# - data:/data/db
# logging:
# driver: none
volumes:
pgdata:
# data:
node_modules: