Giter Club home page Giter Club logo

docker-nginx-php-fpm-heroku's Introduction

nginx-php-fpm-heroku

Minimal image of Nginx + PHP-FPM running on Alpine.

With this image ๐Ÿ‘ you can deploy your PHP project to Heroku via Container Registry ๐Ÿ‘ because layer count and image size are decreased as much as possible to meet Heroku's restriction.

Usage

1. Add Dockerfile into your PHP project

This is just an example. It's of course ready for Composer.

$ cd /path/to/your-php-project
$ tree .
.
โ”œโ”€โ”€ index.php
โ””โ”€โ”€ Dockerfile

0 directories, 3 files
<?php
// index.php
echo 'Hello, Heroku Container Registry!';
# Dockerfile
FROM ttskch/nginx-php-fpm-heroku

# as will be described later, just for local development
USER nonroot

2. Deploy to Heroku

$ heroku login
$ heroku container:login
$ heroku create {appname}
$ heroku container:push web
$ heroku open

Then you can see 'Hello, Heroku Container Registry!' on https://{appname}.herokuapp.com

Local development

Of course you can run your app locally on this image too.

$ docker build . -t {sometag}
$ docker run -p {port}:8888 -v $(pwd):/docroot {sometag}

Or

$ heroku container:push web
$ docker run -p {port}:8888 -v $(pwd):/docroot registry.heroku.com/{appname}/web

Then browse http://localhost:{port}

More examples

See examples.

What's special?

  • Less number of layers
  • Small image size
  • Nginx correctly listens to $PORT which set by Herkou web dyno on runtime
  • As Heroku recommends, can run as non-root user locally (Many permission problems are solved)

Getting involved

Feel free to send Pull Request for

  • Fixing bug or enhancement
  • Adding some examples

docker-nginx-php-fpm-heroku's People

Contributors

brammittendorff avatar ttskch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-nginx-php-fpm-heroku's Issues

supervisor.programs.ini not found

In attempting to build, met with the following. Used the --no-cache flag as well.

COPY failed: stat /var/lib/docker/tmp/docker-builder929036140/supervisor.programs.ini: no such file or directory```

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.