-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
55 lines (51 loc) · 1.2 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
services:
frontend:
build:
context: ./frontend
container_name: frontend
ports:
- 3000:80
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: backend
ports:
- "${BACKEND_PORT}:80"
environment:
DB_DATABASE: '${DB_DATABASE}'
DB_USERNAME: '${DB_USERNAME}'
DB_PASSWORD: '${DB_PASSWORD}'
DB_HOST: '${DB_HOST}'
depends_on:
pgsql:
condition: service_healthy
command: >
sh -c "php artisan migrate && php artisan serve --host=0.0.0.0 --port=80"
pgsql:
image: 'postgres:15'
container_name: database
ports:
- '${DB_PORT}:5432'
environment:
PGPASSWORD: '${DB_PASSWORD}'
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD}'
volumes:
- db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "${DB_DATABASE}", "-U", "${DB_USERNAME}"]
retries: 10
timeout: 2s
blockchain:
build:
context: ./blockchain
container_name: blockchain
ports:
- 7000:7000
environment:
BACKEND_URL: ${BACKEND_URL}
volumes:
db:
driver: local