forked from Project-Books/book-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (48 loc) · 1.16 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
version: "3.8"
services:
frontend:
container_name: book_project_frontend
build:
context: ./frontend
dockerfile: ./Dockerfile
args:
PROFILE: ${PROFILE}
volumes:
- ./frontend/src:/app/src
ports:
- 3000:3000
depends_on:
- backend
db:
image: postgres:14 # 14 is the latest Flyway supported version
container_name: book_project_db
restart: always
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- "5433:5432"
backend:
container_name: book_project_backend
build:
context: ./backend
dockerfile: ./Dockerfile
args:
mvn_arg: clean package -DskipTests
DB_HOSTNAME: book_project_db
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
restart: "no"
ports:
- "8080:8080"
environment:
- POSTGRES_DATABASE=${DB_NAME}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_HOSTNAME=db
- POSTGRES_PORT=5433
depends_on:
- db