mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-19 23:19:50 +00:00
moved project to docker
This commit is contained in:
parent
5aa2463064
commit
d2d48ca39c
20 changed files with 570 additions and 319 deletions
72
code/docker/docker-compose.yaml
Normal file
72
code/docker/docker-compose.yaml
Normal file
|
@ -0,0 +1,72 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue