83 lines
1.8 KiB
YAML
83 lines
1.8 KiB
YAML
# Docker Compose file for FreeCodeCamp
|
|
#
|
|
# If using Docker Toolbox, replace `localhost` to output form `docker-machine ip`
|
|
#
|
|
# If you have previously run freeCodeCamp outside of docker, run
|
|
# npm run clean
|
|
# and select 'yes' to remove all node_module folders
|
|
#
|
|
# before trying to bootstrap the project
|
|
#
|
|
# Bootstrap with:
|
|
# npm run docker:install
|
|
# npm run docker:seed
|
|
#
|
|
# if during install you see errors like `ETXTBSY: text file is busy, rename`
|
|
# then use npm run docker:install2
|
|
#
|
|
# Run with:
|
|
# npm run docker:develop
|
|
#
|
|
version: '3'
|
|
services:
|
|
freecodecamp:
|
|
image: node:lts
|
|
user: node
|
|
depends_on:
|
|
- db
|
|
- mailhog
|
|
environment:
|
|
- MAILHOG_HOST=mailhog
|
|
- MONGOHQ_URL=mongodb://db:27017/freecodecamp
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app
|
|
client:
|
|
image: node:lts
|
|
user: node
|
|
environment:
|
|
- API_PROXY=http://api-server:3000
|
|
- GATSBY_WEBPACK_PUBLICPATH=http://localhost:8000/
|
|
- HOME_LOCATION=http://localhost:8000
|
|
- API_LOCATION=http://localhost:3000
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app/client
|
|
command: npm run develop -- -H '0.0.0.0'
|
|
ports:
|
|
- '8000:8000'
|
|
- '9228:9228'
|
|
api-server:
|
|
image: node:lts
|
|
user: node
|
|
depends_on:
|
|
- db
|
|
- mailhog
|
|
environment:
|
|
- MAILHOG_HOST=mailhog
|
|
- MONGOHQ_URL=mongodb://db:27017/freecodecamp
|
|
- COOKIE_DOMAIN=localhost
|
|
- HOME_LOCATION=http://localhost:8000
|
|
- API_LOCATION=http://localhost:3000
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app/api-server
|
|
command: node development-entry.js
|
|
ports:
|
|
- '3000:3000'
|
|
- '9229:9229'
|
|
db:
|
|
image: mongo:3.6
|
|
ports:
|
|
- '27017:27017'
|
|
volumes:
|
|
- dbdata:/data/db
|
|
mailhog:
|
|
image: mailhog/mailhog
|
|
ports:
|
|
- '1025:1025'
|
|
- '8025:8025'
|
|
|
|
volumes:
|
|
dbdata:
|