mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-15 01:00:32 +00:00
72 lines
1.6 KiB
YAML
72 lines
1.6 KiB
YAML
name: db
|
|
|
|
services:
|
|
# Infrastructure services
|
|
db:
|
|
image: postgres:17
|
|
container_name: postgres-DB
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_USER: ${DB_USER}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
POSTGRES_DB: prisma
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "${DB_USER}", "-d", "prisma"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
networks:
|
|
- app-network
|
|
|
|
minio:
|
|
image: quay.io/minio/minio
|
|
container_name: minio
|
|
ports:
|
|
- "9000:9000" # API
|
|
- "9001:9001" # Web GUI
|
|
environment:
|
|
MINIO_ROOT_USER: ${MINIO_USER}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_PASSWORD}
|
|
MINIO_BROWSER_REDIRECT_URL: "http://localhost:3001/minio"
|
|
command: server /data --console-address ":9001"
|
|
volumes:
|
|
- minio-data:/data
|
|
networks:
|
|
- app-network
|
|
|
|
# Node app - only runs when the "production" profile is activated
|
|
node-app:
|
|
container_name: featherfeed-node
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/Dockerfile
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@postgres-DB:5432/prisma
|
|
ports:
|
|
- "${PORT:-3000}:${PORT:-3000}"
|
|
networks:
|
|
- app-network
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_started
|
|
profiles: ["production"] # Only runs when production profile is activated
|
|
command: >
|
|
sh -c "
|
|
yarn prisma migrate deploy &&
|
|
yarn serve
|
|
"
|
|
|
|
volumes:
|
|
pgdata:
|
|
minio-data:
|
|
|
|
networks:
|
|
app-network:
|
|
name: featherfeed-network
|