forked from OpenLake/Campus-Marketplace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (77 loc) · 1.91 KB
/
Copy pathdocker-compose.yml
File metadata and controls
81 lines (77 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
services:
mongodb:
image: mongo:latest
container_name: campus-mongo
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
networks:
- campus-network
postgres:
image: postgres:latest
container_name: campus-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: campus_pg
# Added PGDATA to support the parent-folder mount strategy
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "5433:5432"
volumes:
- postgres-data:/var/lib/postgresql
networks:
- campus-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d campus_pg"]
interval: 5s
timeout: 5s
retries: 5
backend:
build: ./backend
container_name: campus-backend
ports:
- "5000:5000"
env_file:
- ./backend/.env
environment:
# Force development mode so npm installs devDependencies (nodemon)
- NODE_ENV=development
- CLOUDINARY_CLOUD_NAME
- CLOUDINARY_API_KEY
- CLOUDINARY_API_SECRET
volumes:
- ./backend:/app
- /app/node_modules # Critical: Prevents local folder from wiping container modules
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- mongodb
- postgres
networks:
- campus-network
frontend:
build: ./frontend
container_name: campus-frontend
ports:
- "4173:4173" # Matches your Vite log: "Local: http://localhost:4173/"
env_file:
- ./frontend/.env
environment:
- VITE_APP_MODE=dev
volumes:
- ./frontend:/app
- /app/node_modules # Critical: Ensures @react-oauth/google stays available
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- backend
networks:
- campus-network
volumes:
mongo-data:
postgres-data:
networks:
campus-network:
driver: bridge