-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
82 lines (75 loc) · 2.12 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Docker Compose file to orchestrate both Frontend and Backend services.
#
# INSTRUCTIONS FOR USERS:
# 1. Ensure you have cloned both repositories into a single parent directory:
# - `University-FN` (Frontend repository) https://github.com/Swiatlon/University-FN
# - `University-BN` (Backend repository) https://github.com/Swiatlon/University-BN
#
# Directory structure should look like this:
# Parent Directory/
# ├── University-FN/ # Cloned frontend repository
# └── University-BN/ # Cloned backend repository
#
# 2. Place this `docker-compose.yml` file in the parent directory.
#
# 3. Remove any existing `docker-compose.yml` files from the `University-FN` and `University-BN` repositories.
#
# 4. Use the following commands to manage the application:
# - Start all services in development mode: `docker-compose --profile dev up --build`
# - Start all services in production mode: `docker-compose --profile prod up --build`
services:
frontend-dev:
container_name: frontend-dev
build:
context: ./University-FN
dockerfile: dev.Dockerfile
profiles:
- dev
ports:
- "5173:80"
frontend-prod:
build:
context: ./University-FN
dockerfile: prod.Dockerfile
profiles:
- prod
ports:
- "5173:80"
backend-dev:
container_name: backend-dev
build:
context: ./University-BN
dockerfile: dev.Dockerfile
profiles:
- dev
ports:
- "8800:8800"
depends_on:
- database
command: /bin/sh -c "npm run migration:apply && npm run dev"
backend-prod:
container_name: backend-prod
build:
context: ./University-BN
dockerfile: dev.Dockerfile
profiles:
- prod
ports:
- "8800:8800"
depends_on:
- database
command: /bin/sh -c "npm run migration:apply && npm run start:prod"
database:
image: postgres:15
container_name: postgres_container
env_file:
- ./University-BN/.env
profiles:
- dev
- prod
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data: