Sign inSign up

unicolored/php-app

By unicolored

•Updated about 1 year ago

Works great with Symfony, WordPress. It includes nginx, composer, php-fpm, supervisor, node, yarn...

Image
Web servers
1

5.0K

unicolored/php-app repository overview

⁠Docker Container for php apps

Works great with Symfony, WordPress.

Images are tested and built automatically with Docker Hub.
Public repositories: https://hub.docker.com/u/unicolored⁠

⚠️ Disclaimer : use with caution
All these Dockerfile and config files are mostly for reference. Update and test before using in production.

The builds include:

  • nginx
  • composer
  • php-fpm
  • supervisor
  • node
  • yarn
  • cachetool
  • redis
  • blackfire
  • aws cli
  • and many php modules: amqp, mongodb, mysql, intl, opcache, xdebug, ...

⁠Push an image

⁠DOCKER HUB
#! /bin/bash

set -e

REPOSITORY=php-app
TAG=php82fpm-nginx-bookworm
AWS_HOST=<accoundId>.dkr.ecr.<region>.amazonaws.com/ci
DOCKER_HOST=unicolored

AWS_REPO="${AWS_HOST}/${REPOSITORY}:${TAG}"
DOCKER_REPO="${DOCKER_HOST}/${REPOSITORY}:${TAG}"

# docker login
# aws ecr get-login-password --region eu-west-1 --profile <profile> | docker login --username AWS --password-stdin "${ECR_REPO}"
docker build -t "${DOCKER_REPO}" . \
&& docker push "${DOCKER_REPO}"

# Eventually delete the image locally
docker rmi "${DOCKER_REPO}"

⁠Run a container locally

#! /bin/bash

set -e

CONTAINER_NAME=MyContainer
REPO="<account_number>.dkr.ecr.<region>.amazonaws.com/ci/<repository>:<tag>"

docker stop $CONTAINER_NAME || true
docker rm $CONTAINER_NAME || true
docker build -t "${REPO}" .
docker run -d --name $CONTAINER_NAME -p 1337:80 "${REPO}"
docker exec -it $CONTAINER_NAME /bin/bash

Tag summary

Content type

Image

Digest

sha256:9ba122544…

Size

573.8 MB

Last updated

about 1 year ago

docker pull unicolored/php-app