changed docker compose to use postgres
This commit is contained in:
@@ -1,43 +1,33 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
payload:
|
||||
image: node:18-alpine
|
||||
# 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:
|
||||
# - postgres
|
||||
# env_file:
|
||||
# - .env
|
||||
|
||||
postgres:
|
||||
image: postgres:15
|
||||
container_name: payloadcms_postgres
|
||||
restart: unless-stopped
|
||||
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@latest --activate && pnpm install && pnpm dev"
|
||||
depends_on:
|
||||
- mongo
|
||||
# - postgres
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_DB
|
||||
- POSTGRES_USER
|
||||
- POSTGRES_PASSWORD
|
||||
env_file:
|
||||
- .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:
|
||||
- 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:
|
||||
data:
|
||||
# pgdata:
|
||||
node_modules:
|
||||
|
||||
Reference in New Issue
Block a user