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
This commit is contained in:
Patrik
2025-02-21 13:15:54 -05:00
committed by GitHub
parent 0058f82d87
commit 5d7be15c52
3 changed files with 56 additions and 46 deletions

View File

@@ -2,42 +2,46 @@ version: '3'
services: services:
payload: payload:
image: node:18-alpine image: node:20-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 "corepack enable && corepack prepare pnpm@9.0.0 --activate && pnpm install && pnpm dev"
depends_on: depends_on:
- mongo - postgres
# - postgres # - mongo
env_file: env_file:
- .env - .env
# Ensure your DATABASE_URI uses 'mongo' as the hostname ie. mongodb://mongo/my-db-name # Ensure your DATABASE_URI uses 'postgresql' as the hostname ie. postgresql://127.0.0.1:5432/your-database-name
mongo: postgres:
image: mongo:latest restart: always
ports: image: postgres:latest
- '27017:27017'
command:
- --storageEngine=wiredTiger
volumes: volumes:
- data:/data/db - pgdata:/var/lib/postgresql/data
logging: ports:
driver: none - '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 postgres # Uncomment the following to use mongodb
# postgres: # mongo:
# restart: always # image: mongo:latest
# image: postgres:latest
# volumes:
# - pgdata:/var/lib/postgresql/data
# ports: # ports:
# - "5432:5432" # - '27017:27017'
# command:
# - --storageEngine=wiredTiger
# volumes:
# - data:/data/db
# logging:
# driver: none
volumes: volumes:
data: pgdata:
# pgdata: # data:
node_modules: node_modules:

View File

@@ -2,42 +2,46 @@ version: '3'
services: services:
payload: payload:
image: node:18-alpine image: node:20-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 "corepack enable && corepack prepare pnpm@9.0.0 --activate && pnpm install && pnpm dev"
depends_on: depends_on:
- mongo - postgres
# - postgres # - mongo
env_file: env_file:
- .env - .env
# Ensure your DATABASE_URI uses 'mongo' as the hostname ie. mongodb://mongo/my-db-name # Ensure your DATABASE_URI uses 'postgresql' as the hostname ie. postgresql://127.0.0.1:5432/your-database-name
mongo: postgres:
image: mongo:latest restart: always
ports: image: postgres:latest
- '27017:27017'
command:
- --storageEngine=wiredTiger
volumes: volumes:
- data:/data/db - pgdata:/var/lib/postgresql/data
logging: ports:
driver: none - '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 postgres # Uncomment the following to use mongodb
# postgres: # mongo:
# restart: always # image: mongo:latest
# image: postgres:latest
# volumes:
# - pgdata:/var/lib/postgresql/data
# ports: # ports:
# - "5432:5432" # - '27017:27017'
# command:
# - --storageEngine=wiredTiger
# volumes:
# - data:/data/db
# logging:
# driver: none
volumes: volumes:
data: pgdata:
# pgdata: # data:
node_modules: node_modules:

View File

@@ -68,6 +68,7 @@ async function main() {
dbUri: 'POSTGRES_URL', dbUri: 'POSTGRES_URL',
}, },
sharp: false, sharp: false,
skipDockerCompose: true,
storage: 'vercelBlobStorage', storage: 'vercelBlobStorage',
vercelDeployButtonLink: vercelDeployButtonLink:
`https://vercel.com/new/clone?repository-url=` + `https://vercel.com/new/clone?repository-url=` +
@@ -107,6 +108,7 @@ async function main() {
db: 'postgres', db: 'postgres',
dirname: 'with-postgres', dirname: 'with-postgres',
sharp: true, sharp: true,
skipDockerCompose: true,
storage: 'localDisk', storage: 'localDisk',
}, },
{ {