-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
78 lines (74 loc) · 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_BACKEND_URL=http://backend:8080
- NEXT_PUBLIC_BLOCKCHAIN_NODE_URL=http://blockchain:8545
volumes:
- ./frontend:/app
- /app/node_modules
command: npm run dev
depends_on:
- backend
- blockchain
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/energymarket
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=admin
- SPRING_PROFILES_ACTIVE=dev
- BLOCKCHAIN_NODE_URL=http://blockchain:8545
- CONTRACT_ADDRESS_MARKETPLACE=${CONTRACT_ADDRESS_MARKETPLACE:-0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0}
- CONTRACT_ADDRESS_NFT=${CONTRACT_ADDRESS_NFT:-0x5FbDB2315678afecb367f032d93F642f64180aa3}
volumes:
- ./backend:/app
- ~/.gradle:/root/.gradle
command: ["./gradlew", "bootRun", "--no-daemon"]
depends_on:
postgres:
condition: service_healthy
blockchain:
condition: service_started
blockchain:
build:
context: ./smartcontract
dockerfile: Dockerfile
ports:
- "8545:8545"
env_file:
- ./smartcontract/.env
volumes:
- ./smartcontract:/app
working_dir: /app
command: >
sh -c "
anvil --host 0.0.0.0 &
sleep 5 &&
forge script script/Deployment.s.sol:Deployment --rpc-url http://localhost:8545 --broadcast --private-key ${PRIVATE_KEY}
"
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_DB=energymarket
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data: