chore: persist db and npm scripts for docker
This commit is contained in:
committed by
mrugesh mohapatra
parent
eecae9b14b
commit
a5a4581478
@ -1,21 +1,22 @@
|
|||||||
# Docker Compose file for FreeCodeCamp
|
# Docker Compose file for FreeCodeCamp
|
||||||
#
|
#
|
||||||
# if using Docker Toolbox, replace `localhost` to output form `docker-machine ip`
|
# 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:
|
# Bootstrap with:
|
||||||
# open bash in a container:
|
# npm run docker:install
|
||||||
# docker-compose run --rm freecodecamp bash
|
# npm run docker:seed
|
||||||
# and then from bash prompt:
|
|
||||||
# npm install
|
|
||||||
# npm run seed
|
|
||||||
# exit
|
|
||||||
#
|
#
|
||||||
# if during install you see errors like `ETXTBSY: text file is busy, rename`
|
# if during install you see errors like `ETXTBSY: text file is busy, rename`
|
||||||
# then before install downgrade npm with command:
|
# then use npm run docker:install2
|
||||||
# npm install -g npm@5.7.1
|
|
||||||
#
|
#
|
||||||
# Run with:
|
# Run with:
|
||||||
# docker-compose up
|
# npm run docker:develop
|
||||||
#
|
#
|
||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
@ -42,13 +43,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
working_dir: /app/client
|
working_dir: /app/client
|
||||||
command:
|
command: npm run develop -- -H '0.0.0.0'
|
||||||
- npm
|
|
||||||
- run
|
|
||||||
- develop
|
|
||||||
- --
|
|
||||||
- -H
|
|
||||||
- '0.0.0.0'
|
|
||||||
ports:
|
ports:
|
||||||
- '8000:8000'
|
- '8000:8000'
|
||||||
- '9228:9228'
|
- '9228:9228'
|
||||||
@ -67,9 +62,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
working_dir: /app/api-server
|
working_dir: /app/api-server
|
||||||
command:
|
command: node development-entry.js
|
||||||
- node
|
|
||||||
- development-entry.js
|
|
||||||
ports:
|
ports:
|
||||||
- '3000:3000'
|
- '3000:3000'
|
||||||
- '9229:9229'
|
- '9229:9229'
|
||||||
@ -77,8 +70,13 @@ services:
|
|||||||
image: mongo:3.6
|
image: mongo:3.6
|
||||||
ports:
|
ports:
|
||||||
- '27017:27017'
|
- '27017:27017'
|
||||||
|
volumes:
|
||||||
|
- dbdata:/data/db
|
||||||
mailhog:
|
mailhog:
|
||||||
image: mailhog/mailhog
|
image: mailhog/mailhog
|
||||||
ports:
|
ports:
|
||||||
- '1025:1025'
|
- '1025:1025'
|
||||||
- '8025:8025'
|
- '8025:8025'
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
dbdata:
|
||||||
|
@ -7,6 +7,12 @@
|
|||||||
"develop": "npm-run-all ensure-env -p develop:*",
|
"develop": "npm-run-all ensure-env -p develop:*",
|
||||||
"develop:client": "cd ./client && npm run develop",
|
"develop:client": "cd ./client && npm run develop",
|
||||||
"develop:server": "cd ./api-server && node development-entry.js",
|
"develop:server": "cd ./api-server && node development-entry.js",
|
||||||
|
"docker:bash": "docker-compose run --rm freecodecamp bash",
|
||||||
|
"docker:develop": "docker-compose up",
|
||||||
|
"docker:install": "npm run docker:bash -- -c \"npm install\"",
|
||||||
|
"docker:install2": "docker-compose run --rm -u root freecodecamp bash -c \"npm install -g npm@5.7.1 && su node -c 'npm install'\"",
|
||||||
|
"docker:seed": "npm run docker:bash -- -c \"npm run seed\"",
|
||||||
|
"docker:test": "npm run docker:bash -- -c \"npm run test\"",
|
||||||
"ensure-env": "cross-env DEBUG=fcc:* node ./tools/scripts/ensure-env.js",
|
"ensure-env": "cross-env DEBUG=fcc:* node ./tools/scripts/ensure-env.js",
|
||||||
"format": "npm run lint -- --fix",
|
"format": "npm run lint -- --fix",
|
||||||
"hooks:install": "node node_modules/husky/husky.js install",
|
"hooks:install": "node node_modules/husky/husky.js install",
|
||||||
|
Reference in New Issue
Block a user