GithubHelp home page GithubHelp logo

katebsaber / sanic-nginx-docker-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itielshwartz/sanic-nginx-docker-example

0.0 1.0 0.0 3 KB

Sanic + Nginx + Docker basic example

Python 80.03% HTML 19.97%

sanic-nginx-docker-example's Introduction

Sanic & Nginx & docker-compose example

About

Simple and easy to use skeleton-project using Sanic behined nginx.

Using docker and docker-compose to orchestrate everything.

The app is based on the (great) blog-post for flask: https://realpython.com/blog/python/dockerizing-flask-with-compose-and-machine-from-localhost-to-the-cloud/

How to run?

  • git clone the project
  • Start a new docker-machine: docker-machine create -d virtualbox sanic;
  • Attach to the machine: eval "$(docker-machine env sanic)"
  • Build the containers (This will take a while for the first time!): docker-compose build
  • Create and start containers: docker-compose up -d

Ok what now?

  • Use docker-machine ip sanic to get the machine IP
  • Go to MACHINE-IP/hello-world or MACHINE-IP/static/index.html and validate everything worked.
  • That's It!

Features:

  • /static/* files are served using the nginx.
  • Use the .env file to override or add config values (i override the logo):
    • Just add SANIC_ prefix before var name.

Development

Want to contribute? Great! Feel free to open PR/Issue :)

License

MIT - Free Software, Hell Yeah!

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.