-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (42 loc) · 1.14 KB
/
Copy pathdocker-compose.yml
File metadata and controls
47 lines (42 loc) · 1.14 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
version: "2.3" # Use the latest version of Docker Compose
services:
database:
container_name: database
image: postgres:latest # Specify the PostgreSQL image version explicitly
env_file:
- ./backend-nest/.env # Load environment variables from a file
ports:
- "5438:5432"
volumes:
- database_data:/${HOME}/postgresql/data
networks:
- app_network # Use a user-defined network for better isolation
backend:
container_name: backend
build:
context: ./backend-nest
dockerfile: Dockerfile # You don't need quotes around the Dockerfile path
ports:
- "3000:3000"
- "5555:5555"
env_file: ./backend-nest/.env # Load environment variables from a file
depends_on:
- database # Ensure the backend service starts after the database
networks:
- app_network
frontend:
container_name: frontend
build:
context: ./frontend-vue-vite
dockerfile: Dockerfile
ports:
- "8080:80"
env_file: ./frontend-vue-vite/.env
depends_on:
- backend
networks:
- app_network
volumes:
database_data: {}
networks:
app_network: {}