-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (90 loc) · 2.28 KB
/
docker-compose.yml
File metadata and controls
94 lines (90 loc) · 2.28 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
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
83
84
85
86
87
88
89
90
91
92
93
94
services:
db:
image: pgvector/pgvector:pg15
volumes:
- postgres_data:/var/lib/postgresql/data/
- ./db/init-vector-extension.sql:/docker-entrypoint-initdb.d/init-vector-extension.sql
environment:
- POSTGRES_USER=balancer
- POSTGRES_PASSWORD=balancer
- POSTGRES_DB=balancer_dev
healthcheck:
test: ["CMD-SHELL", "pg_isready -U balancer -d balancer_dev"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5433:5432"
networks:
app_net:
ipv4_address: 192.168.0.2
pgadmin:
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=balancer-noreply@codeforphilly.org
- PGADMIN_DEFAULT_PASSWORD=balancer
ports:
- "5050:80"
depends_on:
db:
condition: service_healthy
networks:
app_net:
ipv4_address: 192.168.0.4
backend:
image: balancer-backend
build: ./server
command: python manage.py runserver 0.0.0.0:8000
restart: on-failure
ports:
- "8000:8000"
env_file:
- ./config/env/dev.env
depends_on:
db:
condition: service_healthy
volumes:
- ./server:/usr/src/server
networks:
app_net:
ipv4_address: 192.168.0.3
healthcheck:
test: ["CMD-SHELL", "python3 -c 'import http.client;conn=http.client.HTTPConnection(\"localhost:8000\");conn.request(\"GET\",\"/admin/login/\");res=conn.getresponse();exit(0 if res.status in [200,301,302,401] else 1)'"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
frontend:
image: balancer-frontend
build:
context: frontend
dockerfile: Dockerfile
args:
- IMAGE_NAME=balancer-frontend
ports:
- "3000:3000"
environment:
- CHOKIDAR_USEPOLLING=true
volumes:
- "./frontend:/usr/src/app:delegated"
- "/usr/src/app/node_modules/"
depends_on:
backend:
condition: service_healthy
networks:
app_net:
ipv4_address: 192.168.0.5
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
networks:
app_net:
ipam:
driver: default
config:
- subnet: "192.168.0.0/24"
gateway: 192.168.0.1