Code Monkey home page Code Monkey logo

django-on-docker's Introduction

—————————————————————————————————————————————

Django的一个运行容器 使用Nginx和uWSGI作为运行环境

概念部分就不过多的赘述了,亲们自行度娘即可

—————————————————————————————————————————————

Dockerfile使用方法:

首先请将此Dockerfile clone到本地 git clone https://github.com/Komey/Django-on-Docker.git

构建本地镜像 sudo docker build -t komeydjango .

运行容器 sudo docker run -d komeydjango

—————————————————————————————————————————————

使用现有代码构建镜像

Ptyhon应用的代码文件,请存放在/app文件夹下,并确保manage.py文件在此文件夹下

Github的上的源码中已包含文件夹的目录结构信息,请查看https://github.com/Komey/Django-on-Docker

/app文件夹下默认带有requirements.txt,该文件记录了你的Python应用所须运行库,在构建时会通过PIP安装文件中的依赖

—————————————————————————————————————————————

镜像使用方法

docker pull index.alauda.cn/lmh5257/django-on-docker

docker run -p 80 -d -e MODULE=myapp index.alauda.cn/lmh5257/django-on-docker

使用本地应用

docker run -p 80 -d -e MODULE=myapp -v /home/komey/myapp:/home/docker/code/app index.alauda.cn/lmh5257/django-on-docker

—————————————————————————————————————————————

可选环境变量:

MODULE = Python应用名(默认为website)

ROOT_PASS = root用户密码(默认随机生成,请查看Log) —————————————————————————————————————————————

更多功能 持续更新ing

django-on-docker's People

Contributors

komey 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.