Skip to content

pythoneyron/EmployeeBase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy Django using Nginx and Postgresql

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

  1. Deploy Django, Gunicorn, NGINX, Postgresql using Docker
  2. Serve Static Files by Nginx from Django using Docker

Where it is described how this boilerplate was created from scratch so that you can build your own.

Basic Usage

  1. First run make build inside root directory.
  2. Then run make up to start up the project for first time.

Commands

To use this project, run this commands:

  1. make build to build the project.
  2. make up-non-daemon to creating containers.
  3. make up to build the project, starting containers and show logs in terminal
  4. make start to start containers if project has been up already.
  5. make stop to stop containers.
  6. make restart to restart containers.
  7. make shell-web to shell access web container.
  8. make shell-db to shell access db container.
  9. make shell-nginx to shell access nginx container.
  10. make logs-web to log access web container.
  11. make logs-db to log access db container.
  12. make logs-nginx to log access nginx container.
  13. make collectstatic to put static files in static directory.
  14. make log-web to log access web container.
  15. make log-db to log access db container.
  16. make log-nginx to log access nginx container.
  17. make restart to restart containers.
  18. make tests to run tests.
  19. make pull to update containers.

Installation - MacOS

  1. Install Docker Server
  2. Git clone project
  3. Create file local.py
    $ scp src/settings/env/local.text src/settings/env/local.py
  4. Add line 127.0.0.1 admin.localhost to file /ets/hosts
    $ sudo nano /etc/hosts
  5. Run the command in the project root folder to build the project
    $ docker-compose build
  6. Next run the command to creating containers
    $ docker-compose up -d
  7. Next run the command to init dump for domain
    $ docker-compose init_dump
  8. Next run the command
    $ docker-compose add_celery_monitor
  9. Next run the command to run project
    $ docker-compose start
  10. Open browser (chrome) and go to url 'admin.localhost:8003'
  11. Command to stop project
    $ docker-compose stop

Installation - Windows

  1. Install Docker Server

  2. Git clone project

  3. Create file local.py

    $ scp src/settings/env/local.text src/settings/env/local.py
  4. Add line 127.0.0.1 admin.localhost to file c:\Windows\System32\Drivers\etc\hosts

  5. Run the command in the project root folder to build the project

    $ docker-compose build
  6. Next run the command to creating containers

    $ docker-compose up -d
  7. Next run the command to init dump for domain

    $ docker-compose init_dump
  8. Next run the command

    $ docker-compose add_celery_monitor
  9. Next run the command to run project

    $ docker-compose start
  10. Open browser (chrome) and go to url 'admin.localhost:8003'

  11. Command to stop project

    $ docker-compose stop

Installation - Linux

Installation docker

  1. ...
    $  sudo apt install apt-transport-https ca-certificates curl software-properties-common
  2. ...
    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  3. ...
    $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
  4. ...
    $ sudo apt update
  5. ...
    $ apt-cache policy docker-ce
  6. ...
    $ sudo apt install docker-ce
  7. ...
    $ sudo systemctl status docker
  8. ...
    $ sudo apt install docker-compose

Run project

  1. Git clone project
  2. Create file development.py
    $ scp src/settings/env/local.text src/settings/env/local.py
  3. Add line 127.0.0.1 localhost to file /ets/hosts
    $ sudo nano /etc/hosts
  4. Run the command in the project root folder to build the project
    $ sudo docker-compose build
  5. Next run the command to creating containers
    $ sudo docker-compose up -d
  6. Next run the command to init dump for domain
    $ sudo docker-compose init_dump
  7. Next run the command
    $ sudo docker-compose add_celery_monitor
  8. Next run the command to run project
    $ sudo docker-compose start
  9. Open browser (chrome) and go to url 'admin.localhost:8002'
  10. Command to stop project
    $ sudo docker-compose stop

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published