{"id":20506257,"url":"https://github.com/casper64/docker-spawner","last_synced_at":"2026-05-05T19:33:00.116Z","repository":{"id":165704868,"uuid":"638972631","full_name":"Casper64/docker-spawner","owner":"Casper64","description":"A service which lets you start and stop docker containers on demand via an http-endpoint and mount them to a dynamic subdomain.","archived":false,"fork":false,"pushed_at":"2023-05-17T07:02:23.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T03:03:42.209Z","etag":null,"topics":["apache","docker","flask","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Casper64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-10T13:43:59.000Z","updated_at":"2023-05-15T20:16:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"df988e3a-1740-46cb-9fe3-1218c10635b7","html_url":"https://github.com/Casper64/docker-spawner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Casper64/docker-spawner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casper64%2Fdocker-spawner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casper64%2Fdocker-spawner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casper64%2Fdocker-spawner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casper64%2Fdocker-spawner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Casper64","download_url":"https://codeload.github.com/Casper64/docker-spawner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Casper64%2Fdocker-spawner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32664961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","docker","flask","python"],"created_at":"2024-11-15T19:55:29.332Z","updated_at":"2026-05-05T19:33:00.098Z","avatar_url":"https://github.com/Casper64.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Spawner\n\nDocker Spawner is a service which lets you start and stop docker containers on\ndemand via an http-endpoint and mount them to a dynamic subdomain.\n\n## Features\n\n-   Http endpoints\n-   Reverse proxy from subdomain to docker container\n-   Configured for Apache\n\n## Installation\n\nClone the repository and navigate to the folder\n\n```bash\ngit clone https://github.com/Casper64/docker-spawner\ncd docker-spawner\n```\n\n## Python\n\nTo setup the server first create a virtual environment and then install the packages.\n\n**Linux example:**\n\n```bash\npython -m venv venv\n. ./venv/bin/activate\npip install -r requirements.txt\n```\n\n## Dynamic subdomain\n\nIn order to use Docker Spawner you need to have a [wildcard DNS record] for your domain.\n\nIn `apache.conf` is a default configuration for Apache which you can extend. Make sure to always\ninclude the `Include` rule and update the default values.\n\n## Usage\n\nReplace `YOUR_PORT` and run the app with flask from your virtual environment or\n[run it as a service](#systemd-service).\n\n```bash\nflask --app app run --port=YOUR_PORT --host=0.0.0.0\n```\n\n## Systemd Service\n\nYou can also run Docker Spawner as a service on your server.\n\n### Setup\n\nChange the default values in `docker-spawner.service`.\n\nCopy `docker-spawner.service` to your `systemd` folder.\n\n```bash\nsudo cp docker-spawner.service /etc/systemd/system/\n```\n\nReload the systemd daemon to load the service.\n\n```bash\nsudo systemctl daemon-reload\n```\n\nEnable and start the service at startup.\n\n```bash\nsudo systemctl enable docker-spawner\nsudo systemctl start docker-spawner\n```\n\n## Endpoints\n\n### Start a docker container: `POST /spawn`\n\nRequired form data:\n\n-   `container_id`: the id of the container specified in `CONTAINER_IMAGES`\n-   `user_id`: the users is, when [users support](#users-support) is enabled\n\nReturns\nReturns `HTTP 4xx` with an error message if the request failed.\n\n### Stop a docker container: `POST /stop`\n\nRequired form data:\n\n-   `container_hex`: the hex identifer of the docker container. You can obtain it from `/spawn`\n\n### Get hex from a container by user id `GET /get_container_hex`\n\n\u003e **Note**: this route is only enabled when [users support](#users-support) is enabled\n\nrequired query parameters\n\n-   `user_id`: the users id\n\n## Settings\n\nYou can edit the configuration in `app/settings.py`.\n\n### Port ranges\n\n`PORT_START` and `MAX_CONTAINERS` will set the range of ports where docker containers\ncan be spawned:\n\nPort range = `[PORT_START, (PORT_START + MAX_CONTAINERS)]`\n\n### Container images\n\n`CONTAINER_IMAGES` is a dict where the value is the name of a docker container and\nthe key is the id that will be check when you post to `/spawn`.\n\nYou can customize all other constants in `main.py`.\n\n### Users Support\n\nYou can couple a docker container to a user. User support is enabled by default.\nTo disable it set `WITH_USERS` to `False`.\n\n\u003e **Note**: user support assumes that only 1 user can have a docker container\n\u003e active at all time, but this isn't verified!\n\nWhen user support is enable the `/get_container_hex` endpoint becomes available.\n\nYou can view the other configuration options in `app/settings.py`.\n\n\u003c!-- Links --\u003e\n\n[wildcard DNS record]: https://en.wikipedia.org/wiki/Wildcard_DNS_record\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasper64%2Fdocker-spawner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasper64%2Fdocker-spawner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasper64%2Fdocker-spawner/lists"}