Giter VIP home page Giter VIP logo

billy's Introduction

billy

A really nice "bang for your buck" Docker image to quickly bootstrap your Django projects

Bootstrap your project as fast as Billy the Kid draws it's gun =)

$ mkdir quickdrawproject
$ cd quickdrawproject
$ python3.6 -m venv .env
$ source .env/bin/activate

Blazing fast dependency setup - magic start's here

$ curl https://raw.githubusercontent.com/andreportela/billy/master/requirements.txt | grep '^[a-z]' | xargs pip install
$ django-admin startproject project .

Quickly draw a simple database setup on your settings.py

# bunch of other imports here
import dj_database_url as db
# bunch of other setup statements here
DATABASES = dict()
DATABASES['default'] = db.config()

Take a break from billy and just code your project ;)

Create your custom Dockerfile with billy's huge boilerplate

FROM andreportela/billy
ADD . ${BASE_FOLDER}

Make a dirty quick docker-compose.yml just to try your shiny new project - polish it later =D

version: "3"

services:
  db:
    image: postgres:10.4-alpine
    ports:
      - 5432:5432
    environment:
      - POSTGRES_PASSWORD=mysecretpassword

  quickdrawproject:
    build: .
    command: ["sh", "-c", "/app/postgres_ready.py --prevent_ssl --host=db && python manage.py migrate && exec gunicorn --access-logfile - -w 4 project.wsgi:application -b 0.0.0.0:80"]
    depends_on:
      - db
    environment:
      - DATABASE_URL=postgres://postgres:mysecretpassword@db:5432/postgres
    ports:
      - 80:80

Just run it!

$ docker-compose up

Now open your browser on http://localhost and see it working as fast as Billy The Kid!


TIPS

When you want to use a specific version

Say you want to use billy v0.1.0:

  1. Install local requirements from the v0.1.0 version
$ curl https://raw.githubusercontent.com/andreportela/billy/v0.1.0/requirements.txt | grep '^[a-z]' | xargs pip install
  1. Reference the given version on your Dockerfile
FROM andreportela/billy:v0.1.0
ADD . ${BASE_FOLDER}

billy's People

Contributors

andreportela avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

janiramos

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.