GithubHelp home page GithubHelp logo

php-8.0-apache's Introduction

Docker

PHP 8.0 Apache Base Image

This base image contains some helper functionality to get a basic PHP project up and running. It utilizes Task and contains some basic tasks to perform common functionality.

Pre-installed PHP Extensions

The following PHP extensions are installed into this base image by default. You can view the modules by running docker run oberd/php-8.0-apache php -m

To include additional extensions, follow the steps from the official PHP base image documentation. Although, You should consider if the extension should be added to the base image or your project specific Dockerfile.

[PHP Modules]
bcmath
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
soap
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

Usage

The usage folder folder contains an example Dockerfile and Taskfile.yml that you can include in your project to get up and running.

Helpers

Commands

If you're making a development stage of a multi-stage Dockerfile and want to enable Xdebug (should not be enabled in a production environment), you can add the following line to your development stage. It will install and enable the xdebug extension.

RUN enable-xdebug

Taskfile

The following tasks to be ran in a Taskfile are already pre-configured in /usr/local/tasks/ for usage in your projects. Check the sample Taskfile.yml for a standard usage in a Laravel environment.

Apache

start

This task will start Apache in the foreground

task -t tasks/apache.yml start

Laravel

routes

This task will cache your Laravel routes. Should only really be used in a production environment.

task -t tasks/laravel.yml cache

migrate

This task will run your Laravel migrations using the --force flag.

task -t tasks/laravel.yml migrate

Composer

The Composer tasks should really only be ran in a development environment where the vendor directory may be volume mounted and cannot be included into the Docker image itself. A production image should contain the installed vendor directory within the image for consistency.

configure

This task will configure composer with your Github OAuth token to allow access to private repositories and not be rate limited.

Requires: the environment variable GITHUB_OAUTH_TOKEN to be set.

task -t tasks/composer.yml configure

install

This task is dependent upon the configure task being ran. It will run composer install.

task -t tasks/composer.yml install

PHP

xdebug-host

This task will configure the Xdebug remote host into the Xdebug config.

Optional: the environment variable XDEBUG_HOST_IP can be set. Else, it will default to 10.254.254.254

Sites

Using the built in Apache commands a2ensite and a2dissite to enable and disable site configurations, this base image contains pre-defined configurations for some standard PHP frameworks.

Laravel

To configure a standard Laravel project your code to /var/www/app and this configuration will point the DocumentRoot to the public folder /var/www/app/public

RUN a2ensite laravel
COPY --chown=www-data:www-data . /var/www/app

php-8.0-apache's People

Contributors

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