Skip to content

create-payload-app with postgreSQL is missing postgreSQL in docker-compose.yml file #12764

Open

Description

@steinybot

Describe the Bug

create-payload-app does not seem to use the docker-compose.yml file from the with-postgres tempalte, it has mongo instead of postgres.

Link to the code that reproduces this issue

https://github.com/steinybot/create-payload-app-postgres-bug

Reproduction Steps

pnpx create-payload-app@latest

answer the prompts with:

postgres-bug
website
PostgreSQL
postgres://postgres:<password>@127.0.0.1:5432/postgres-bug

PS: It is strange that the below output says that the project is configured to use yarn when it clearly said that it was using pnpm

Image

Which area(s) are affected? (Select all that apply)

Not sure

Environment Info

> [email protected] payload /Users/jason/src/lbra/website/postgres-bug
> cross-env NODE_OPTIONS=--no-deprecation payload info

! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing [email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e.
! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager

 ERROR  This project is configured to use yarn
For help, run: pnpm help

Binaries:
  Node: 20.17.0
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  payload: 3.42.0
  next: 15.3.0
  @payloadcms/db-postgres: 3.42.0
  @payloadcms/email-nodemailer: 3.42.0
  @payloadcms/graphql: 3.42.0
  @payloadcms/live-preview: 3.42.0
  @payloadcms/live-preview-react: 3.42.0
  @payloadcms/next/utilities: 3.42.0
  @payloadcms/payload-cloud: 3.42.0
  @payloadcms/plugin-form-builder: 3.42.0
  @payloadcms/plugin-nested-docs: 3.42.0
  @payloadcms/plugin-redirects: 3.42.0
  @payloadcms/plugin-search: 3.42.0
  @payloadcms/plugin-seo: 3.42.0
  @payloadcms/richtext-lexical: 3.42.0
  @payloadcms/translations: 3.42.0
  @payloadcms/ui/shared: 3.42.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10

Activity

  1. added
    status: needs-triage
    validate-reproduction
    on Jun 11, 2025
  2. removed
    validate-reproduction
    on Jun 11, 2025
  3. JessRynkar commented on Feb 6, 2026

    @JessRynkar
    Member

    Hi! Apologies for the long delay in getting a response here, are you still experiencing this on the latest version v3.75.0?

  4. LionelB5 commented on Feb 16, 2026

    @LionelB5

    Hi @JessRynkar - Confirming the docker-compose.yml is missing postgresql in the latest release.

    I am using [email protected]

    These are the options I selected when creating the project:

    │
    ◇   ────────────────────────────────────────────╮
    │                                               │
    │  Welcome to Payload. Let's create a project!  │
    │                                               │
    ├───────────────────────────────────────────────╯
    │
    ◇  Project name?
    │  payload-experiment
    │
    ◇  Choose project template
    │  website
    │
    ◇  Select a database
    │  PostgreSQL
    │
    ◇  Enter PostgreSQL connection string
    │  postgres://postgres:<password>@127.0.0.1:5432/payload-experiment
    │
    ◇  Found latest version of Payload 3.76.1
    │
    ◇  Using npm.
    │
    ◇  Successfully installed Payload and dependencies
    │
    ▲  ? Failed to initialize git repository.
    │
    ◇  Payload project successfully created!
    │
    ◇   Next Steps
    │
    │
    │  Launch Application:
    │
    │    - cd ./payload-experiment
    │    - npm run dev or follow directions in README.md
    │
    │  Documentation:
    │
    │    - Getting Started
    │    - Configuration
    │
    │
    │
    └   Have feedback?  Visit us on GitHub.
    

    And this is the docker-compose that is output:

    version: '3'
    
    services:
      payload:
        image: node:18-alpine
        ports:
          - '3000:3000'
        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
    
    volumes:
      data:
      node_modules:
    
  5. blazardsky commented on Mar 4, 2026

    @blazardsky
  6. self-assigned this
    on Mar 11, 2026
  7. removed
    status: needs-triage
    on Mar 11, 2026
  8. darylf commented on Oct 22, 2026

    @darylf

    Still reproducible in Payload 3.91.0 (October 22, 2026).

    I created a new project using npx create-payload-app@latest with the following selections:

    • Template: website
    • Database: PostgreSQL
    • Package manager: npm (automatically selected by the installer)
    • Coding agent: Codex

    The project was generated successfully, and src/payload.config.ts correctly uses postgresAdapter with DATABASE_URL.

    However, the generated docker-compose.yml still contains:

    services:
      payload:
        image: node:22.23.4-alpine
        command: sh -c "yarn install && yarn dev"
        depends_on:
          - mongo
    
      mongo:
        image: mongo:latest

    There are two inconsistencies:

    1. Database mismatch: PostgreSQL was selected during setup, but Docker Compose provisions MongoDB.
    2. Package manager mismatch: The installer selected npm, but Docker Compose runs Yarn.

    I also noticed that several generated package.json scripts reference pnpm, although I haven't tested whether these cause additional issues.

    The generated Docker configuration therefore does not reflect the selections made during project creation.

    I would expect the generated Compose configuration to use PostgreSQL and the selected package manager, or for the installer to clearly indicate that the included Docker configuration is only a generic example requiring manual changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions