This is an online editor that runs docker on the server side (multiple compilers).
I am using some well-known frameworks in this project.
- websockets
- dockerode
- monaco-editor
Because of its popularity and prevalence, docker is suitable for our purposes.
You can adapt any compiler or programming language as you wish.
Install node.js, docker and download all dependencies.
npm install
npm start
Install docker and customize the configuration file docker/Dockerfile
.
FROM <name>
RUN apt update && \
apt install -y application1 application2 ...
docker build -t <name> - < docker/Dockerfile
Verify the installed applications.
docker run <application1> -h
docker run <application2> -h
...
Upload your tagged image to the registry docker hub.
docker login -u <username>
docker tag <name> <username>/<name>
docker push <username>/<name>
Replaces the default image "th3r3alduk3/editor-docker:latest" in app.js
.
docker.createImage({fromImage: "th3r3alduk3/editor-docker:latest"}).then(() => {
...
}).catch(error => {
console.log("please start docker daemon");
});