docs(Docker): Refactored Docker environment. (#16825)

docker-compose.yml renamed to sample.docker-compose.yml.
docker-compose.yml added to .gitignore so every developer can copy it from sample.docker-compose.yml and make changes according to their local needs.

docs(Docker): Updated docs for Docker install.
Added Docker specific installation instructions.

docs(Docker): Applied changes requested on PR.
Extra 8000 port forwarding removed.
Mongo db configuration moved inside dokcer-compose config.
Cleanup spacing and typos.

docs(Docker): Added docker and docker-compose installation links.
pull/16850/merge
otar 2018-03-23 10:20:21 +04:00 committed by mrugesh mohapatra
parent 294f3e0453
commit a7f5785b04
4 changed files with 54 additions and 28 deletions

2
.gitignore vendored
View File

@ -56,3 +56,5 @@ public/css/main*
webpack-bundle-stats.html
server/rev-manifest.json
google-credentials.json
docker-compose.yml

View File

@ -288,6 +288,27 @@ node seed
npm run develop
```
### Setup freeCodeCamp via Docker
You need to have [docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/) installed before executing commands below.
Create docker-compose.yml from sample file
```bash
cp sample.docker-compose.yml docker-compose.yml
```
Setup and run project:
```bash
# Setup project
docker-compose run --rm node npm install
docker-compose run --rm node npm run only-once
```
```bash
# Run project
docker-compose up
```
### Make Changes
This bit is up to you!

View File

@ -1,28 +0,0 @@
# Docker Compose file for FreeCodeCamp
#
# Bootstrap with:
# docker-compose run --rm server npm install
# docker-compose run --rm server npm run only-once
#
# Run with:
# docker-compose up
#
version: "2"
services:
db:
image: mongo:3.2.6
server:
image: node:8.9.0
depends_on:
- db
environment:
- MONGOHQ_URL=mongodb://db:27017/freecodecamp
volumes:
- .:/fcc
working_dir: /fcc
command:
- npm
- start
ports:
- "3000:3000" # Change port if needed

31
sample.docker-compose.yml Normal file
View File

@ -0,0 +1,31 @@
# Docker Compose sample file for freeCodeCamp
# Copy this file to docker-compose.yml
#
# Bootstrap with:
# docker-compose run --rm node npm install
# docker-compose run --rm node npm run only-once
#
# Run with:
# docker-compose up
#
version: "3"
services:
node:
image: node:8.9.4
volumes:
- .:/app
working_dir: /app
depends_on:
- mongo
ports:
- "3000:3000"
- "3002:3002"
environment:
- MONGOHQ_URL=mongodb://mongo:27017/freecodecamp
command: npm run develop
mongo:
image: mongo:3.0.15
mailhog:
image: mailhog/mailhog