-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
64 lines (60 loc) · 1.61 KB
/
docker-compose.yml
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
version: '3'
services:
# PostgreSQL database service
db:
image: postgres:13
restart: always
container_name: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- '5432:5432'
user: "postgres:postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# PgAdmin service to manage the PostgreSQL database
pgadmin:
image: dpage/pgadmin4
restart: always
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
ports:
- '5050:80'
depends_on:
- db
# Backend (NestJS) service
backend:
build:
context: ./Server # Path to the backend Dockerfile
dockerfile: Dockerfile
container_name: nest-backend
environment:
DATABASE_URL: ${DATABASE_URL}
ports:
- '3000:3000'
depends_on:
- db
volumes:
- ./Server/src:/app/src # For live development
command: sh -c "npm install && npx prisma migrate dev && npm run dev:docker"
# Frontend (Vue.js) service
frontend:
build:
context: ./Client # Path to the frontend Dockerfile
dockerfile: Dockerfile
container_name: vue-frontend
ports:
- '5173:80' # Exposing port 5173
depends_on:
- backend # Wait for backend to be up before starting frontend
volumes:
postgres-data: # Volume for persisting PostgreSQL data