Skip to content

prakashsharmacs24/django-docker-compose

Repository files navigation

The "Django Docker Compose" is a reference application created to show how

to develop Django based application using the docker and docker compose.

Maintained by: Prakash Kumar

Built With

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them Deploy

Docker version 18.03.1-ce, build 9ee9f40
docker-compose version 1.21.1, build 7641a569,

How to use this image

Run Application with a Docker/Docker-Compose

This is the recommended way to run application. You can use the following docker compose template:

version: '3'

services:
  db:
    image: postgres
  web:
    build: .
    command: python3 manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    depends_on:
      - db

Execute this command to install the project:

  1. Clone the project repository
git clone --depth=1 https://github.com/prakashsharmacs24/django-docker-compose
cd django-docker-compose
  1. Builds the images define in the docker-compose.yml
docker-compose build
  1. Create your containers
docker-compose up -d
  1. Make Migration
docker-compose run web python manage.py makemigrations
docker-compose run web python manage.py migrate
  1. Start New Application
docker-compose run web python manage.py startapp demo_app
  1. Close Docker container When you’re done, don’t forget to close down your Docker container.
docker-compose down

License

MIT License

Copyright (c) 2018 prakashkumar(mailto:prakashsharmacs24@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Run your Django website using docker compose

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages