Coder Social home page Coder Social logo

daniel-tomaszuk / single-docker-nginx-uwsgi-django Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 2.51 MB

Configuration of single image Docker, nginx, uWSGI to serve Django application.

Python 48.32% CSS 0.09% JavaScript 28.74% HTML 21.70% Shell 1.14%
docker nginx uwsgi django django-rest-framework

single-docker-nginx-uwsgi-django's Introduction

single-docker-nginx-uwsgi-django

Configuration of docker, nginx, uWSGI to serve Django application.

Starting the application

  • Application alone can be found in /app subdirectory and run with django developer server: ./manage.py runserver. In that case application can be accessed by typing: localhost:8000 in the browser
  • To build docker image you should enter build_folder (where the Dockerfile is) and run: sudo docker build -t my_app
  • After building the image, it is possible to run the application: sudo docker run -p 8000:8000 -t my_app. Application will be accessible at: 0.0.0.0:8000 (it is also possible to access the running application by your local machine ip address - check by $ ifconfig or $ ip add in the console on port 8000)

Restarting running uWSGI to reload changes in the code

The running Docker image with nginx and uWSGI serving Django won't automatically reload whole application. To reload it one must follow these steps:

  • log into running Docker image: check ID of the Docker container you want to log into by $ sudo docker ps,
  • log in: $ sudo docker exec <container_ID> /bin/bash
  • after getting into the container, make sure you are in the same directory as uwsgi_reload file, then type: $ touch uwsgi_reload in the console. uWsgi will start chain_reload procedure.

Configuration files

  • Docker: /build_folder/Dockerfile
  • uWSGI: /build_folder/app/uwsgi.ini
  • nginx: /build_folder/nginx-app.conf
  • Django: /build_folder/app/Satelite_Tracking/settings.py

Links

single-docker-nginx-uwsgi-django's People

Contributors

daniel-tomaszuk avatar

Stargazers

 avatar Rafal M avatar

Watchers

James Cloos 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.