chore: migrate from PostgreSQL to MongoDB and update environment configuration
This commit is contained in:
+12
-12
@@ -8,10 +8,10 @@ services:
|
||||
ports:
|
||||
- "${API_PORT:-3671}:3671"
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-theplug}:${POSTGRES_PASSWORD:-theplug_dev_password}@postgres:5432/${POSTGRES_DB:-theplug}
|
||||
MONGODB_URL: mongodb://${MONGO_USER:-theplug}:${MONGO_PASSWORD:-theplug_dev_password}@mongodb:27017/${MONGO_DB:-theplug}?authSource=admin
|
||||
REDIS_URL: redis://redis:6379/0
|
||||
depends_on:
|
||||
postgres:
|
||||
mongodb:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
@@ -22,20 +22,20 @@ services:
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
container_name: theplug-postgres
|
||||
mongodb:
|
||||
image: mongo:8
|
||||
container_name: theplug-mongodb
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-theplug}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-theplug}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-theplug_dev_password}
|
||||
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-theplug}
|
||||
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-pass}
|
||||
MONGO_INITDB_DATABASE: ${MONGO_DB:-theplug}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- mongodb_data:/data/db
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-theplug} -d ${POSTGRES_DB:-theplug}"]
|
||||
test: ["CMD-SHELL", "mongosh --quiet --username ${MONGO_USER:-theplug} --password ${MONGO_PASSWORD:-theplug_dev_password} --authenticationDatabase admin --eval \"db.adminCommand({ ping: 1 }).ok\" | grep 1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -58,5 +58,5 @@ services:
|
||||
start_period: 5s
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
mongodb_data:
|
||||
redis_data:
|
||||
|
||||
Reference in New Issue
Block a user