Skip to content

Base docker image with alpine to run PHP applications in azk.

License

Notifications You must be signed in to change notification settings

quintanilhar/docker-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Base docker image to run PHP applications in azk

Circle CI ImageLayers Size ImageLayers Layers

PHP Versions (tags)

- [`latest`, `5.6`](https://github.com/azuki-images/php/blob/master/5.6/Dockerfile)

Usage with azk

Example of using this image with azk:

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */

// Adds the systems that shape your system
systems({
  "php": {
    // Dependent systems
    depends: [], // postgres, mysql, mongodb ...
    // More info about php image: http://images.azk.io/#/azuki-images/php?from=images-azkfile-php
    image: {"docker": "azukiapp/php:5.6"},
    // or use Dockerfile to custimize your image
    //image: {"dockerfile": "./Dockerfile"},
    // Steps to execute before running instances
    provision: [
      "composer install"
    ],
    workdir: "/azk/#{manifest.dir}",
    command: "php -S 0.0.0.0:80 -t /azk/#{manifest.dir}/public",
    wait: {"retry": 20, "timeout": 1000},
    mounts: {
      "/azk/#{manifest.dir}" : sync("."),
      "/azk/#{manifest.dir}/vendor": persistent("./vendor"),
      "/azk/#{manifest.dir}/composer.lock": path("./composer.lock"),
    },
    scalable: {"default": 1},
    http: {
      domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    ports: {
      http: "80/tcp",
    },
    envs: {
      // set instances variables
      APP_ENV: "development"
    },
  },
});

Extend image with Dockerfile

Install more packages:

# Dockerfile
FROM azukiapp/php:5.6

# install internationalization functions
RUN  apk add --update php-intl \
  && rm -rf /var/cache/apk/* /var/tmp/* \

To build the image:

$ docker build -t azukiapp/php:5.6 .

To more packages, access alpine packages

Usage with docker

To run the image and bind to port 80:

$ docker run -it --name my-app -p 80:80 -v "$PWD":/myapp -w /myapp azukiapp/php:5.6

Logs

# with azk
$ azk logs my-app

# with docker
$ docker logs <CONTAINER_ID>

License

Azuki Dockerfiles distributed under the Apache License.

About

Base docker image with alpine to run PHP applications in azk.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 66.3%
  • JavaScript 17.2%
  • Makefile 16.5%