Remote Code Executor WebApp and API to execute code in docker containers. Developed with Socket.io, React, Dockerode.
java8
, java11
, python2
, python3
, typescript
, javascript
, golang
, c
, c++
Install dependencies in both backend / frontend
yarn install
cd frontend/
yarn install
Run Development Servers
# open two seperate terminals
# in backend server
yarn run start:dev
# in the other terminal
cd frontend/
yarn run watch
DOCKER_SOCK=<socket to docker daemon | default is /run/docker.sock>
DOCKER_TIMEOUT=<time in ms for dockerode to timeout | default is 5000>
SERVER_PORT=<port for server to run | default is 3000>
GET /api/v1/runtimes
POST /api/v1/execute
[
{
"language": "java",
"dockerImage": "openjdk:11-jdk-slim",
"aliases": [
"java11"
]
},
{
"language": "python3",
"dockerImage": "python:3-alpine",
"aliases": [
"py3"
]
}
]
Example request body
// java example
{
"language": "java",
"code": "public class Main { public static void main(String[] args) { System.out.println(\"Hello World\");}}",
"filename":"Main.java"
}
// python example
{
"language":"python3",
"code":"print('hello world')",
"filename":"test.py"
}
Example response
{
"language": "java",
"output": {
"stdout": "Hello World\n",
"stderr": ""
}
}