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.
feat(.devcontainer): basic codespaces config (freeCodeCamp#48484)
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
- Loading branch information
1 parent
0a7b769
commit 1ba31f0
Showing
4 changed files
with
84 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,30 @@ | ||
ARG VARIANT=20.04 | ||
FROM mcr.microsoft.com/devcontainers/base:ubuntu-${VARIANT} | ||
|
||
ARG NODE_VERSION=18 | ||
ARG MONGODB_VERSION=6.0.4 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y sudo && \ | ||
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo -E bash - && \ | ||
sudo apt-get install -y nodejs && \ | ||
sudo apt-get install -y libcurl4 openssl liblzma5 && \ | ||
mkdir -p /tmp/mongodb && \ | ||
cd /tmp/mongodb && \ | ||
wget -qOmongodb.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-${MONGODB_VERSION}.tgz && \ | ||
tar -zxvf mongodb.tgz && \ | ||
cd mongodb-* && \ | ||
sudo cp bin/* /usr/local/bin/ && \ | ||
rm -rf /tmp/mongodb && \ | ||
sudo mkdir -p /data/db && \ | ||
sudo chown vscode:vscode -R /data/db | ||
|
||
# Setup ENV | ||
ENV COOKIE_DOMAIN=github.dev | ||
ENV HOME_LOCATION=https://$CODESPACE_NAME-8000.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN | ||
ENV API_LOCATION=https://$CODESPACE_NAME-3000.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN | ||
ENV CYPRESS_BASE_URL=https://$CODESPACE_NAME-8000.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN | ||
ENV REACT_APP_CHALLENGE_EDITOR_API_LOCATION=https://$CODESPACE_NAME-3200.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN | ||
ENV CHALLENGE_EDITOR_CLIENT_LOCATION=https://$CODESPACE_NAME-3300.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN | ||
|
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,24 @@ | ||
{ | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"freeCodeCamp.freecodecamp-dark-vscode-theme" | ||
] | ||
} | ||
}, | ||
"dockerFile": "Dockerfile", | ||
"forwardPorts": [3000, 8000, 27017], | ||
"portsAttributes": { | ||
"8000": { | ||
"label": "Learn", | ||
"onAutoForward": "openPreview" | ||
} | ||
}, | ||
"postCreateCommand": "cp sample.env .env && npm ci", | ||
// It is more reliable to start these processes oneself | ||
// "postStartCommand": "mongod &", | ||
// "postAttachCommand": "npm run develop", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}" | ||
} |
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,6 @@ | ||
FROM node:18-alpine | ||
|
||
# Install git | ||
RUN apk add --no-cache git | ||
|
||
RUN npm install -g docsify-cli prettier eslint |
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,24 @@ | ||
{ | ||
"context": "../..", | ||
"customizations": { | ||
"codespaces": { | ||
"openFiles": ["docs/how-to-work-on-the-docs-theme.md"] | ||
}, | ||
"vscode": { | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"freeCodeCamp.freecodecamp-dark-vscode-theme" | ||
] | ||
} | ||
}, | ||
"dockerFile": "Dockerfile", | ||
"forwardPorts": [3400], | ||
"portsAttributes": { | ||
"3400": { | ||
"label": "Docs", | ||
"onAutoForward": "openPreview" | ||
} | ||
}, | ||
"postAttachCommand": "npm run docs:serve" | ||
} |