Code Monkey home page Code Monkey logo

django-docker-bootstrap's Introduction

django-docker-bootstrap

Requirements Status Build Status Dependency Status postgres nginx

Concept

A cookiecutter template for Django/Nodejs(React)/Nginx/Postgres. The main idea behind this project to create an easily configurable and easy to use django development/production environment for any project.

Installation

  • Docker requires a 64-bit OS.
  • Install the docker(1.10.2),docker-compose(1.6.2) - https://docs.docker.com/engine/installation/
  • Requirements for cookiecutter: apt-get install python-dev
  • Then get cookiecutter: pip install Markdown cookiecutter
  • Finally enter the directory where you want to store your project and enter the following: * cookiecutter https://github.com/legios89/django-docker-bootstrap.git

Cookiecutter params

  • project_name: The name of the project.
  • repo_name: The directory name(automtically generated from the project_name).
  • db_password: The postgres user password for the database.
  • use_translation: Translation integration(Rosetta, ModelTransalation, admin integration).
  • use_react: React, NodeJS, React-Router to replace the django frontend.
  • admin_name: The name of the admin user who will receive the error messages.
  • admin_email: The email address of the admin user who will receive the error messages.
  • email_host_user: The gmail email address what the system can use to send emails.
  • email_host_password: The gmail email address password what the system can use to send emails.

Usage

  • Build the images: bash buildall.sh
  • Start the project: docker-compose up
  • You can set every secret variable in the env.txt in the root
  • If you want to run the project in production mode you need to set the following environment variable:

Tips & Tricks

Images

  1. base
  • Contains every data(db, files, logs) and connected to every other container as a volume (/data/).
  • If you delete the base container you will lose everything (be cautious)
  1. postgres
  • postgresql-9.4
  • The 5433 port is open by default if you want to connect the db with a client
  • Commands:
    • shell - start a bash shell dc run --rm postgres shell
    • backup - create a backup (/data/backup/<backup_name>) dc run --rm postgres backup
    • restore - restore from a backup (/data/backup/<backup_name>) dc run --rm postgres restore
  1. django-python3
  • The projects can be found under the /src/ directory
  • Installed Apps:
    • Django: 1.9.4
    • uWSGI: 2.0.12
    • psycopg2: 2.6.1
    • django-debug-toolbar: 1.4
    • djangorestframework: 3.3.3 + optional packages
    • django-cleanup: 0.4.2
    • django-extensions: 1.6.1
    • django-compressor: 2.0
    • django-rosetta: 0.7.10 [optional]
    • django-modeltranslation: 0.11rc2 [optional]
  • Commands:
    • shell -start a bash shell dc run --rm django shell
  1. nginx
  • Commands:
    • shell -start a bash shell dc run --rm nginx shell
  • Installed Apps:
    • Nginx: 1.8.1
  1. nodejs [optional]
  • Commands:
    • shell -start a bash shell dc run --rm nodejs shell
    • start_build -start the react build process than exit dc run --rm nodejs start_build
    • Installed Apps:
      • nodejs: 4.x.x
      • npm: 2.x.x
    • Installed Packages: [automatically installed]
      • react: 0.14.7,
      • react-dom: 0.14.7,
      • babelify: 7.2.0,
      • babel-preset-react: 6.5.0,
      • browserify: 13.0.0,
      • watchify: 3.7.0,
      • react-router: 2.0.1

django-docker-bootstrap's People

Contributors

legios89 avatar

Watchers

 avatar  avatar

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.