logo
68
1
Login

Python + Flask + Docker

badge badge badge

In this example, you will use Cloud Native Build (CNB) to package the "python-flask-docker" project, build a Docker image and push it to the Docker artifact repository.

Prerequisites

  1. Use Cloud Native Build (CNB) to build your project
  2. Learn how to use Docker Artifact Repository

This template demonstrates a fully automated workflow:

  • Code checkout
  • Docker image building
  • Pushing to Docker artifact repository

File Descriptions

The example includes:

  • README.md - This file. Project overview and instructions
  • Dockerfile - Script for automatic Docker image building
  • requirements.txt - Dependency file
  • app.py - Main Flask server source code
  • .ide/Dockerfile - Configuration file for cloud native development
  • .cnb.yml - Configuration file for cloud native build

Quick Start

The following instructions assume you want to develop this project on your local machine.

  1. Install dependencies
$ pip3 install -r requirements.txt
  1. Start the server
$ python3 app.py
  1. Open http://127.0.0.1:5000/

About

打包python-flask-docker项目,构建并将构建产物上传docker制品库中

example
856.00 KiB
68 forks1 stars2 branches0 TagREADMEOther license
Language
Markdown45.4%
Dockerfile16.5%
Python12.9%
Others25.2%