Multi-language code compiler container (C, C++, Python, Java, JS, Rust, Lua, Go) with API support.
10K+
This Docker container is designed to run a variety of compilers including C, C++, Python, Java, JavaScript, Rust, Lua and Go. It also includes a custom server built using Node.js and Express, which allows you to compile code via an HTTP API.
The VE Compiler 2.0 is included to handle the compilation of code, and the container exposes an API to compile code in multiple languages.
To build the Docker image, run the following command in the root directory of your project (where the Dockerfile is located):
docker build -t eshan04dev/ve-compiler-container .
Once the image is built, you can run the container with the following command:
docker run -p 4000:4000 eshan04dev/ve-compiler-container
This will run the container and expose the server on port 4000.
The container exposes the following HTTP endpoints:
POST /compile-code: Use this endpoint to compile code by sending a JSON request with the code and language.
Example request:
{
"code": "print('Hello, world!')",
"language": "py"
}
Example response:
{
"output": "Hello, world!"
}
GET /health: Use this endpoint to check if the server is running. It returns a 200 OK status with a timestamp.
Example response:
{
"status": "server is running",
"timestamp": "2024-12-25T12:34:56Z"
}
Ensure Docker is installed on your machine. You can download Docker from here.
If you don't want to build the image yourself, you can pull the pre-built image from Docker Hub:
docker pull eshan04dev/ve-compiler-container
Run the pulled image:
docker run -p 4000:4000 eshan04dev/ve-compiler-container
Content type
Image
Digest
sha256:75b5865fd…
Size
399.7 MB
Last updated
almost 2 years ago
docker pull eshan04dev/ve-compiler-container