badger/docker-compose.yml

81 lines
2.0 KiB
YAML
Raw Permalink Normal View History

2022-10-11 03:25:25 +00:00
version: '3.8'
services:
2023-03-10 21:47:49 +00:00
# Run the hardhat node
badger_local_hardhat_node:
2022-10-11 06:48:56 +00:00
build:
2023-03-10 21:47:49 +00:00
dockerfile: Dockerfile.dev.node
2022-10-11 06:48:56 +00:00
context: ./contracts
volumes:
- .:/contracts/code
2022-10-11 07:18:30 +00:00
env_file:
- ./.env
2022-10-11 06:48:56 +00:00
ports:
- "8545:8545"
restart: unless-stopped
2023-03-10 21:47:49 +00:00
command: npx hardhat run scripts/deploy/deploy.js
2022-10-11 03:25:25 +00:00
badger_db:
image: postgres:13.2
container_name: badger_db
2023-03-10 21:47:49 +00:00
restart: always
2022-10-11 03:25:25 +00:00
environment:
POSTGRES_PASSWORD: badger
POSTGRES_USER: badger
POSTGRES_DB: badger
2023-03-10 21:47:49 +00:00
volumes:
- ./api/database:/var/lib/postgresql/data
hostname: badger_db
2022-10-11 03:25:25 +00:00
ports:
- '5432:5432'
2023-03-10 21:47:49 +00:00
# Run the badger server
web:
2023-03-06 02:11:59 +00:00
container_name: badger_server
2023-03-04 21:13:20 +00:00
build:
dockerfile: Dockerfile.dev
context: ./api
2023-03-10 21:47:49 +00:00
command: >
sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
restart: always
2023-03-06 02:11:59 +00:00
ports:
- '8000:8000'
2023-03-04 21:13:20 +00:00
env_file:
- ./.env
2022-10-11 03:25:25 +00:00
volumes:
- ./api:/code
2022-10-11 03:25:25 +00:00
depends_on:
- badger_db
links:
2023-03-10 21:47:49 +00:00
- badger_db
# Run the React frontend
frontend:
2022-10-11 06:48:56 +00:00
container_name: badger_frontend
build:
dockerfile: Dockerfile.dev
context: ./frontend
args:
2023-03-10 21:47:49 +00:00
# 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
2022-10-11 06:48:56 +00:00
volumes:
2022-10-13 20:32:08 +00:00
- ./frontend:/code
- /code/node_modules
- /code/public
2023-03-05 21:27:42 +00:00
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
2023-03-10 21:47:49 +00:00
env_file:
- ./.env
2022-10-11 06:48:56 +00:00
depends_on:
2023-03-10 21:47:49 +00:00
- web
2022-10-11 06:48:56 +00:00
links:
2023-03-10 21:47:49 +00:00
- web