-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
80 lines (80 loc) · 1.98 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
79
80
version: '3.8'
services:
# Run the hardhat node
badger_local_hardhat_node:
build:
dockerfile: Dockerfile.dev.node
context: ./contracts
volumes:
- .:/contracts/code
env_file:
- ./.env
ports:
- "8545:8545"
restart: unless-stopped
command: npx hardhat run scripts/deploy/deploy.js
badger_db:
image: postgres:13.2
container_name: badger_db
restart: always
environment:
POSTGRES_PASSWORD: badger
POSTGRES_USER: badger
POSTGRES_DB: badger
volumes:
- ./api/database:/var/lib/postgresql/data
hostname: badger_db
ports:
- '5432:5432'
# Run the badger server
web:
container_name: badger_server
build:
dockerfile: Dockerfile.dev
context: ./api
command: >
sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
restart: always
ports:
- '8000:8000'
env_file:
- ./.env
volumes:
- ./api:/code
depends_on:
- badger_db
links:
- badger_db
# Run the React frontend
frontend:
container_name: badger_frontend
build:
dockerfile: Dockerfile.dev
context: ./frontend
args:
# use FONTAWSOME_TOKEN in .env to get access to private fontawesome packages
FONTAWESOME_NPM_AUTH_TOKEN: ${FONTAWESOME_NPM_AUTH_TOKEN}
command: npm start --host 0.0.0.0 --disableHostCheck true
restart: always
ports:
- '3000:3000'
# make sure the volumes for hot reloading to work are setup
volumes:
- ./frontend:/code
- /code/node_modules
- /code/public
environment:
- NODE_OPTIONS=--openssl-legacy-provider
# ENABLE this to use the local backend
- REACT_APP_BACKEND_URL=http://localhost:8000
# Enable this for hot reloads
- CHOKIDAR_USEPOLLING=true
- WATCHPACK_POLLING=true
- WDS_SOCKET_HOST=127.0.0.1
- NODE_ENV=development
env_file:
- ./.env
depends_on:
- web
links:
- web