This project include AWS elastic beanstalk docker deploy files for docker-run service.
The service based on glot.io code.
┌────────────────────────────────────────────┐
│ Studyhub http client │
└────────────────────────────────────────────┘
│ │
│ │
▼ ▼
┌──────────────────┐ ┌─────────────────────┐
│ save │ │ │
│ create-react-app │ │ │
│ build from -> │ │ docker-run docker │
└──────────────────┘ └─────────────────────┘
│
│
▼
┌─────────────────────────┐
│ docker │
│ ┌───────────────────┐ │
│ │ glot-images │ │
│ │ ┌─────────────┐ │ │
│ │ │ code-runner │ │ │
│ │ └─────────────┘ │ │
│ └───────────────────┘ │
└─────────────────────────┘
- We have a 'celery' queue with a task build 'create react app'. Building process (webpack build) takes too many system resources, so we need to use queue to limit building proccess to one at the same period of time.
- User runs command 'publish sandbox' from VSCode editor.
- Task created and added to the celery queue.
- Tasks broker (rabbitmq) run 'publish sandbox' task.
- Task makes an HTTP request to the 'docker-run' web service with JSON data of sandbox files.
- docker-run service starts container with docker image 'create-react-app' (glot-image).
- glot-image run code-runner with build commands
- run command creates archive with build files result and return with HTTP response to Studyhub
- Task get result of docker-run response and save static files in the Django media folder.
- Application serves with nginx as static files to exclude server-side application compromising.