123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- version: '3.8'
- services:
- # Frontend - React Application
- frontend:
- build:
- context: ./frontend
- dockerfile: Dockerfile
- ports:
- - "3000:3000"
- environment:
- - REACT_APP_API_URL=http://backend:5000
- depends_on:
- - backend
- networks:
- - app-network
- # Backend - Node.js API
- backend:
- build:
- context: ./backend
- dockerfile: Dockerfile
- ports:
- - "5000:5000"
- environment:
- - NODE_ENV=development
- - DATABASE_URL=postgresql://postgres:password@database:5432/byop_sample
- - JWT_SECRET=your-secret-key-here
- depends_on:
- - database
- networks:
- - app-network
- # Database - PostgreSQL
- database:
- image: postgres:15
- environment:
- - POSTGRES_USER=postgres
- - POSTGRES_PASSWORD=password
- - POSTGRES_DB=byop_sample
- ports:
- - "5432:5432"
- volumes:
- - postgres_data:/var/lib/postgresql/data
- - ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
- networks:
- - app-network
- volumes:
- postgres_data:
- networks:
- app-network:
- driver: bridge
|