-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
47 lines (43 loc) · 1.24 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
version: '3.8'
services:
backend:
build:
context: ./backend
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
environment:
DB_USER: postgres
DB_PASSWORD: password
DB_NAME: postgres
DB_HOST: postgres
DB_PORT: 5432
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
depends_on:
- backend
postgres:
image: postgres:14
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
volumes:
- ./sql_scripts:/docker-entrypoint-initdb.d/sql_scripts
- ./production_sql_scripts:/docker-entrypoint-initdb.d/production_sql_scripts
- ./data:/docker-entrypoint-initdb.d/data
- ./production_data:/docker-entrypoint-initdb.d/production_data
# SWITCH BETWEEN THE BELOW TWO INIT SCRIPTS TO SWAP FROM SAMPLE (init.sql) TO PRODUCTION (init_production.sql)
# - ./sql_scripts/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./sql_scripts/init_production.sql:/docker-entrypoint-initdb.d/init_production.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5