logo
68
1
Login
docs: 更新文档地址

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/