• This repository has been archived on 29/Jun/2023
  • Stars
    star
    102
  • Rank 333,671 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight RESTful docker PaaS

Spin-docker: A lightweight RESTful docker PaaS

NOTE: spin-docker is no longer under active development. If you need a Docker PaaS, I recommend looking at the dokku, Deis, or Flynn projects.

Spin-docker is a lightweight platform-as-a-service that runs on a RESTful API. Designed with simplicity in mind, spin-docker provides enough features to help you stand up your own Docker-powered PaaS in minutes.

Spin-docker was created by Andrew T. Baker as a side project this winter. It might not be the best Docker-based PaaS out there, but building it was a great learning experience. Check out my blog post about it: http://andrewtorkbaker.com/what-makes-a-good-side-project

Spin-docker is open source under the MIT license.

Full documentation is available on ReadTheDocs: http://spin-docker.readthedocs.org/

Example use

Spin-docker uses a RESTful API so you can easily start and stop docker containers with an HTTP request. Start a PostgreSQL database with:

$ curl http://localhost:8080/v1/containers -X POST -u admin:spindocker -d "image=atbaker/sd-postgres"

And you'll receive back:

{
  "status": "running",
  "name": "/desperate_poincare",
  "active_connections": "0",
  "ssh_port": "49153",
  "image": "atbaker/sd-postgres",
  "container_id": "0145c3630dccc5529ecd3a61d0e7f04236ef3e7a91d06b2985f50e9aa4dc266d",
  "uri": "/v1/containers/0145c3630dccc5529ecd3a61d0e7f04236ef3e7a91d06b2985f50e9aa4dc266d",
  "app_port": "49154"
}

The atbaker/sd-postgres docker image runs a PostgreSQL database using Phusion's base docker image. Spin-docker images report their activity back to spin-docker so it can stop idle containers, but spin-docker is fully compatible with all docker images.

You can SSH into the container using Phusion's insecure key (included in the spin-docker root directory):

$ ssh -i insecure_key [email protected] -p 49153
$ su postgres -c 'psql'

And of course you (or an app) can connect to the PostgreSQL database directly if you have the PostgreSQL client installed:

$ psql -U postgres -h 127.0.0.1 -p 49154

And that's it! Here are a few ideas for how spin-docker could help your organization:

  • Use the PostgreSQL, MongoDB, and Django images available now to provide on-demand databases and webservers for developers and data scientists
  • Create a docker image for your own app and use spin-docker to provide on-demand demo servers for your teams
  • Jump start your next training or tutorial session by putting a sample environment in a docker image and using spin-docker to quickly expose those environments to your students

Or just play with spin-docker to learn more about how docker works! Using Vagrant and Ansible, you can deploy your own spin-docker server anywhere in minutes. Read getting started with spin-docker for more information.

More Repositories

1

wikipedia-question-generator

Uses NLP and wikipedia to try to generate trivia questions
Python
131
star
2

docker-tutorial

Introductory and advanced docker tutorials. Presented at PyOhio on 7/26/14
Python
53
star
3

hypermasher

A Node.js application which shows users a stream of the latest Hyperlapse videos set to chill music
JavaScript
21
star
4

docker-workshop

A two-hour Docker workshop for DockerDC
15
star
5

intro-to-docker

Links to all the source code and solutions I reference in my O'Reilly Introduction to Docker video tutorial
11
star
6

five-ways-to-deploy

The source code for my PyCon 2017 talk "5 ways to deploy you Python web app in 2017"
Python
10
star
7

imgur-uploader

A simple command line client for uploading files to Imgur
Python
10
star
8

docker-django

A simple Django application for use during my Docker tutorials
Python
8
star
9

db-conservatory

A front end for spin-docker which allows users to provision databases on demand
CSS
7
star
10

django-class-based-views-tutorial

A short tutorial about a unique Django feature: Class-based views
Python
7
star
11

wikitrivia

A trivia game based on NLP-extracted Wikipedia questions
JavaScript
6
star
12

sd-django

A Django + Gunicorn Dockerfile compatible with spin-docker
Python
6
star
13

zero-to-production

A sample Flask application to accompany my Zero to Production
Python
6
star
14

tweetcheck

A dead-simple review process for your organization's tweets
Python
5
star
15

mongo-example

A Dockerfile for a MongoDB server
Shell
3
star
16

nginx-example

A Dockerfile for a simple static website served by Nginx
HTML
3
star
17

sd-postgres

A PostgreSQL Dockerfile compatible with spin-docker
Shell
3
star
18

flask-example

A sample Flask app
Python
2
star
19

speck

Speck is an open source, privacy-first local AI agent application
Python
2
star
20

django-example

A Dockerfile for a sample Django application
Python
1
star
21

redis-example

A Dockerfile for a redis server
Shell
1
star
22

resume

A resume built for the web that's not half bad as a PDF
HTML
1
star
23

co-organizer

A small web app to help meetup organizers get attendees into their events
Python
1
star
24

flask-tutorial

Python
1
star
25

twiml-boomerang

A microservice for your Twilio fallback URLs that gives your original request another chance
Python
1
star
26

autopilot-text-adventure

A small companion repository for my Twilio Autopilot holiday text adventure app
1
star
27

docker-flask

A simple Flask application for use in my Docker tutorials
Python
1
star
28

sd-mongo

A MongoDB Dockerfile compatible with spin-docker
Shell
1
star