Giter Club home page Giter Club logo

paus's Introduction

Paus: Docker Compose PaaS

Bring your app to the cloud easily.

Deploy application by 2 steps:

  • Prepare docker-compose.yml on the repository
  • git push paus master

That's all. You don't have to learn the platform-specific file anymore.

Demo (YouTube)

Demo

Try on local machine with Vagrant

At first, run script/bootstrap 🚀

$ script/bootstrap

Prepare .env

Set environment variables in .env.

MUST: PAUS_GITHUB_CLIENT_ID and PAUS_GITHUB_CLIENT_SECRET are required to launch Paus. Create new OAuth application from here, then write Client ID and Client Secret in .env For Vagrant, callback URL should be "http://paus.dev/oauth/callback".

Launch Paus

3 CoreOS machines are launched.

$ vagrant up
$ vagrant dns --install
$ vagrant dns --start

Sign up & Create application.

Access to http://paus.dev and sign up with your GitHub account.

After that, create application.

Write ~/.ssh/config

Host paus.dev
  User git
  Port 2222
  IdentityFile ~/.ssh/id_rsa
  StrictHostKeyChecking no

Prepare docker-compose.yml

e.g. Wordpress + MySQL

$ cd /path/to/your/app
$ cat docker-compose.yml
version: '2'
services:
  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: wordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  web:
    depends_on:
      - db
    image: wordpress:latest
    links:
      - db
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_PASSWORD: wordpress

Add Git remote repository

$ git remote add paus [email protected]:<username>/<app_name>

Push!

$ git push paus master

Access to the application

Access to the URL shown the end of deployment.

Modules

Paus consists of the below modules:

Presentation material

paus's People

Contributors

dtan4 avatar skade avatar

Stargazers

 avatar Tim Cowlishaw avatar jon ⚝ avatar Alex Mills avatar Naoki Shibayama avatar Comamoca avatar Unix Doughnut avatar Entrapta Jones avatar Jellyfish.tech avatar  avatar Žiga Pavlin avatar  avatar Nikolaus Schlemm avatar C Reimers avatar Yazid Jibrel avatar Alexander Pushkov avatar Jaivarsan avatar Kenneth Reitz avatar Yasuhiro Yamaguchi avatar Adrian Chifor avatar  avatar Daniel Beck avatar Zoltán Müllner avatar Stefano Azzolini avatar Armen avatar dmnlk avatar  avatar rinsuki avatar AkiraFukushima avatar Haruka Asakura avatar Ryuta Hamasaki avatar Nate Wienert avatar Yan Anisimov avatar morioka shuhei avatar bnn avatar shuogawa avatar Minerva White avatar Tetsuhiro Sato avatar MasaruTech avatar Giovanni Gaglione avatar Nick Soto avatar Kodai Sakabe avatar Atsushi Yamaguchi avatar  avatar Kento Nagata avatar Daisuke Taniwaki avatar misoobu avatar Naoto Gohko avatar Nobuto HACHIYA avatar kbaba10011 avatar Shuhei Kagawa avatar supermomonga avatar Atsushi NAGASE avatar Hiromi Motodera avatar mdaisuke avatar P-Chan avatar Masahiro Miyashiro (3846masa) avatar Yuuki Shimizu avatar mapyo avatar Kevin Hatfield avatar Yuki Takemoto avatar Nao Minami avatar Markus Heurung avatar Kenta Suzuki avatar  avatar Takumi KANZAKI avatar Masayuki Morita avatar  avatar Fumihiko Shiroyama avatar Morita Naoki avatar Yuichi Saito avatar yohei sugigami avatar Shimpei Takamatsu avatar j-nishina avatar Shinichi Goto avatar tkmknr avatar Yuki Iwanaga avatar

Watchers

James Cloos avatar Fumihiko Shiroyama avatar Naoto Gohko avatar  avatar

paus's Issues

Add LICENSE

WHY

To release as public, we have to declare licenses.

Migrate to ECS

WHY

Currently Paus runs on Docker Swarm cluster + etcd. I had tested and evaluated Paus cluster at our development/staging environments, and then I found there are some difficulties to maintain Swarm cluster.

Pros of Swarm + etcd

  • Run on local machine as well as cloud
  • Easy to implement
  • Docker Registry is not necessary

Cons

  • Difficult to get container/service logs
  • Difficult to delete launching services
  • Difficult to scale machines/containers
  • Sometimes swarm Docker daemon hangs up
  • Executing docker-compose command is required

WHAT

Migrate backend to AWS ECS. With ECS, most operations will be conducted easily.

Pros of ECS

  • Easy to get container/service logs via CloudWatch Logs
  • Easy to scale machines/containers by AutoScaling + CloudWatch Metrics
  • Be able to manage services via API
  • docker-compose command is no more required

Cons of ECS

  • Cannot run on local machine
  • Ops engineer have to set up ECS cluster at first
  • Some external Docker Registry is required

TODO

  • Push images built on Paus to ECR
  • Deploy
    • Create TaskDefinition
    • Create Service
    • Register Service to reverse proxy
  • Change Datastore from etcd to DynamoDB
  • Change dashboard backend to ECS + DynamoDB

Launch paus-frontend at 80/tcp

WHY

Now paus-frontend launches at 8080/tcp. We have to access to frontend with URL http://pausapp.com:8080.
Adding :8080 is not beautiful, and therefore firewall (e.g. ELB) have to open 8080/tcp toward public Internet.

WHAT

Add Vulcand rule: 80/tcp from Internet to paus-frontend (8080/tcp).

Set environment variables

WHY

Sometimes we want to connect to external database (e.g. RDS) from application, and also we need to set API token.

WHAT

Make it possible to set environmental variable in application.

Store application metadata

WHY

To implement application list page, we have to know:

  • When the application is deployed
  • Who is the owner of the application

WHAT

Store application metadata in etcd.

Proposed directory structure

/paus/

# apps
/paus/apps/
/paus/apps/rails-sample/
/paus/apps/gin-sample/

# app
/paus/apps/rails-sample/container #=> container ID of the latest deployed container
/paus/apps/rails-sample/owner #=> username of the latest deployed container
/paus/apps/rails-sample/revision #=> revision of the latest deployed container
/paus/apps/rails-sample/timestamp #=> timestamp of the latest deployed container

# users
/paus/users/
/paus/users/dtan4/
/paus/users/someone/

# apps in user
/paus/users/dtan4/rails-sample/
/paus/users/dtan4/gin-sample/

# revisions
/paus/users/dtan4/rails-sample/revisions/
/paus/users/dtan4/rails-sample/revisions/sa345gh #=> timestamp of deployed sa345gh
/paus/users/dtan4/rails-sample/revisions/bg2b83e #=> timestamp of deployed bg2b83e

# environment variables
/paus/users/dtan4/rails-sample/envs/
/paus/users/dtan4/rails-sample/envs/FOO # => value of $FOO
/paus/users/dtan4/rails-sample/envs/BAR # => value of $BAR

Show container logs

WHY

We want to debug our containers with their logs.

WHAT

Show container logs as streaming on web browser.

Abandoned?

Hi, I'm interested to know if this was abandoned and, if so, why? I think this is a great idea.

Inject build-time variables

WHY

Some Dockerfiles require to inject build-time variables. For example, fetching private repository from GitHub requires GITHUB_ACCESS_TOKEN.

FROM ruby:2.3.0-slim
MAINTAINER Daisuke Fujita <[email protected]> (@dtan4)

ARG GITHUB_ACCESS_TOKEN

# ...

RUN git clone https://$GITHUB_ACCESS_TOKEN:[email protected]/dtan4/privaterepo
$ docker build --build-arg GITHUB_ACCESS_TOKEN=githubtoken ,

docker-compose.yml:

version: '2'
services:
  web:
    build:
      context: .
      args:
        - "GITHUB_ACCESS_TOKEN=${GITHUB_ACCESS_TOKEN}"
    ports:
      - 3000:3000
    links:
      - elasticsearch:elasticsearch
      - redis:redis
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch:9200
      - REDIS_HOST=redis
      - REDIS_PORT=6379

WHAT

As environment variable injection like, implement the feature to set build-time variables.

  • frontend: Register build args from application page.
  • gitreceive: Inject build args before building Docker (web) image.

etcd key: /paus/users/dtan4/rails-sample/build-args/FOO

TODO

REF

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.