-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
66 lines (61 loc) · 1.46 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
version: '3.8'
services:
backend:
container_name: backend
build:
context: ./backend
dockerfile: Dockerfile
ports:
- 3000:3000
environment:
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: ${DB_HOST}
DB_NAME: ${DB_NAME}
DB_PORT: ${DB_PORT}
depends_on:
postgresql:
condition: service_healthy
volumes:
- ./backend:/app/backend
postgresql:
container_name: postgresql_database
image: postgres:15.0
ports:
- 5432:5432
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- ./create-database.sql:/docker-entrypoint-initdb.d/create-database.sql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- my-db:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}" ]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
# pgadmin:
# container_name: pgadmin
# image: dpage/pgadmin4
# environment:
# PGADMIN_DEFAULT_EMAIL: admin@admin.com
# PGADMIN_DEFAULT_PASSWORD: dbpassword
# ports:
# - 8082:80
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- 5173:5173
environment:
VITE_API_URL: ${VITE_API_URL}
volumes:
- ./frontend:/app
- /app/node_modules
volumes:
my-db: