Giter Site home page Giter Site logo

rajibmitra / azure-functions-docker-python-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure/azure-functions-docker-python-sample

0.0 1.0 0.0 285 KB

A sample of using docker to deploy a Python based app

License: MIT License

Python 100.00%

azure-functions-docker-python-sample's Introduction

This repository hosts the instructions and neccessary artifacts for building and publishing Python Functions as a Docker container on Linux.

For comprehensive information about Python in Azure Functions, refer to the azure-functions-python-worker repo.

Getting Started

Prerequisites

Download the sample

In a terminal window, run the following command to clone the sample app repository to your local machine, then change to the directory that contains the sample code.

git clone https://github.com/Azure/azure-functions-docker-python-sample.git
cd azure-functions-docker-python-sample

Understanding the environment

In the Git repository, take a look at the Dockerfile. This file describes the environment that is required to run Python functions on Linux.

# Base the image on the built-in Azure Functions Python image
FROM microsoft/azure-functions-python3.6:v2.0.11737-alpha

# Add files from this repo to the root site folder.
COPY . /home/site/wwwroot

# Install requirements
RUN cd /home/site/wwwroot && pip install -r requirements.txt

Build and deploy the custom image

To build and test your image locally, and deploy to Azure, follow the instructions here -

Create a function on Linux using a custom image

Configure storage

Azure Functions needs a storage account in order to run locally.

The best way to add this is to create a Storage Account in Azure and pass the connection string as an environment variable called AzureWebJobsStorage to the docker run command.

docker run -p 8080:80 -it -e AzureWebJobsStorage="{connection-string}" <docker-id>/mydockerimage:v1.0.0

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

azure-functions-docker-python-sample's People

Contributors

asavaritayal avatar ahmelsayed avatar microsoftopensource avatar jwendl avatar msftgits avatar

Watchers

 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.