Coder Social home page Coder Social logo

buildpack-example's Introduction

Buildpacks Example

Table Of Contents

About The Project

This repo serves as a minimal example reference on creating a FastAPI application container with Buildpacks.

Requirements

NOTE - Run all commands from the project root

Building

Building

Check which Buildpacks are available

pack builder suggest
Suggested builders:
	Google:                gcr.io/buildpacks/builder:v1      Ubuntu 18 base image with buildpacks for .NET, Go, Java, Node.js, and Python
	Heroku:                heroku/buildpacks:18              Base builder for Heroku-18 stack, based on ubuntu:18.04 base image
	Heroku:                heroku/buildpacks:20              Base builder for Heroku-20 stack, based on ubuntu:20.04 base image
	Paketo Buildpacks:     paketobuildpacks/builder:base     Ubuntu bionic base image with buildpacks for Java, .NET Core, NodeJS, Go, Ruby, NGINX and Procfile
	Paketo Buildpacks:     paketobuildpacks/builder:full     Ubuntu bionic base image with buildpacks for Java, .NET Core, NodeJS, Go, PHP, Ruby, Apache HTTPD, NGINX and Procfile
	Paketo Buildpacks:     paketobuildpacks/builder:tiny     Tiny base image (bionic build image, distroless-like run image) with buildpacks for Java Native Image and Go

For this example we use the default Heroku-20 stack

Note: In a real world setup you may want to use a custom builder tailored for your code.

Configure pack to use heroku/buildpacks:20 as default Buildpack

pack config default-builder heroku/buildpacks:20

If everything goes well you should see Builder heroku/buildpacks:20 is now the default builder in your CLI.

Build the image with pack build

pack build svx/fastapi-pip:1.0.0

Now you should see lots of CLI output, like pulling and extracting images and layers, this will take some minutes (depending on your internet connection and cache of local images).

When the build is successful you should see something like

Successfully built image svx/fastapi-pip:1.0.0

Running

docker run -p 5000:5000 --name fastapi svx/fastapi-pip:1.0.0

Open your browser and browse to http://localhost:5000/

buildpack-example's People

Contributors

svx avatar

Watchers

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