forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tools): integrate gitpod for development workflow (freeCodeCamp#3…
- Loading branch information
1 parent
88e1bef
commit 769a672
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM gitpod/workspace-full | ||
|
||
USER gitpod | ||
WORKDIR $HOME | ||
|
||
RUN wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.6.13.tgz && \ | ||
mkdir -p mongodb && \ | ||
tar xaf mongodb-linux-x86_64-ubuntu1604-3.6.13.tgz -C mongodb --strip-components=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
image: | ||
file: .gitpod.Dockerfile | ||
ports: | ||
- port: 27017 # mongodb | ||
onOpen: ignore | ||
- port: 8000 # client | ||
onOpen: open-preview | ||
- port: 9228 # node debug | ||
onOpen: ignore | ||
- port: 3000 # api | ||
onOpen: ignore | ||
- port: 9229 # node debug | ||
onOpen: ignore | ||
|
||
tasks: | ||
- name: db | ||
# starting mongo in background, so it doesn't block prebuilds | ||
before: > | ||
mkdir -p /workspace/data && | ||
(~/mongodb/bin/mongod --dbpath /workspace/data &) | ||
- name: server | ||
before: export COOKIE_DOMAIN=gitpod.io && export HOME_LOCATION=$(gp url 8000) && export API_LOCATION=$(gp url 3000) | ||
# init is not executed for prebuilt workspaces and restarts, | ||
# so we should put all the heavy initialization here | ||
init: > | ||
cp sample.env .env && | ||
npm ci && | ||
gp await-port 27017 && | ||
npm run seed && | ||
~/mongodb/bin/mongo --eval "db.fsyncLock(); db.fsyncUnlock()" | ||
command: > | ||
npm run ensure-env && | ||
gp await-port 27017 && | ||
npm run develop:server | ||
- name: client | ||
before: export HOME_LOCATION=$(gp url 8000) && export API_LOCATION=$(gp url 3000) | ||
command: > | ||
gp await-port 3000 && | ||
cd ./client && | ||
npm run develop -- -H '0.0.0.0' | ||
openMode: split-right |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters