Giter Club home page Giter Club logo

docker-django's Introduction

Docker Compose configuration for Django development (and production) with Nginx, Celery, Redis and PostgreSQL

A boilerplate to deploy Django with cool stuff. Also serves as an example project from these tutorials:

  1. Deploy Django, Gunicorn, NGINX, Postgresql using Docker
  2. Serve Static Files by Nginx from Django using Docker
  3. Docker: Use Celery in Django (Redis as Broker)

The above tutorials describe how this boilerplate was created from scratch so that you can build your own.

Basic Usage

  1. Fork the repo to your GitHub account.
  2. git clone the repo to your local computer.
  3. Run make build inside the root directory to build/rebuild (if necessary) all the containers in the project.
  4. Then run make up to start the containers and have them run as a daemon process (i.e., in the background).
  5. Visit http://localhost:8000/ to see the project.
  6. Visit http://localhost:8000/admin to view the admin login screen. No users have been setup, so you won't be able to login until after you have done that.

Checkout the commands section below for more usage.

Preview

A default Django project resides in src directory. When you start the project, you will see the following screen at http://localhost:8000/:

Demo One

Also when you access the django container log via make log-web, you will see the following:

Demo Two

Commands

The following commands can be run inside the project root directory (see the Makefile in this project for more details):

  1. make build to build/rebuild (if necessary) all the containers in the project.
  2. make up to start the containers and have them run as a daemon process (i.e., in the background).
  3. make up-non-daemon to start containers and have them run as a non-daemon process.
  4. make start to start containers, if the project has already been built.
  5. make stop to stop containers.
  6. make restart to restart containers.
  7. make shell-web to gain shell access into the web container.
  8. make shell-db to gain shell access into the db container.
  9. make shell-nginx to gain shell access into the nginx container.
  10. make log-web to view the logs in the web container.
  11. make log-db to view the logs in the db container.
  12. make log-nginx to view the logs in the nginx container.
  13. make collectstatic to put static files in the static directory.

docker-django's People

Contributors

ruddra avatar samuelearl avatar serkansokmen 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.