Sign inSign up

nafigat0r/php-cli

By nafigat0r

Updated almost 4 years ago

PHP CLI SAPI

Image
0

707

nafigat0r/php-cli repository overview

How to use this image

Initialise UID
export UID

If you does not use bash-shell initialize UID variable with your current user ID. Example:

export UID=1000
Create a docker-compose.yml

Suggested path for docker-compose.yml root of your project.

version: '3.6'
services:
  php:
    image: nafigat0r/php-cli:7.2
    user: ${UID}:${UID}
    command: script.php
    volumes:
      - ./:/var/www/html/
    restart: unless-stopped

Than add ini-settings to override.ini

xdebug.remote_host = 192.168.100.100
xdebug.remote_enable = 1

xdebug.remote_host - host machine IP

Build and run container
docker-compose build --force-rm --no-cache --pull
docker-compose up -d --remove-orphans
Extending PHP configuration

Create new volume in docker-compose.yml like this:

    volumes:
      - ./override.ini:/etc/php/7.2/cli/conf.d/zz-override.ini
Change locale and timezone

Create Dockerfile:

FROM nafigat0r/php-cli:7.2

# Change locale
RUN sed -i -e "s/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/" /etc/locale.gen \
    && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales \
    && update-locale LANG=ru_RU.UTF-8

ENV LANG ru_RU.UTF-8

# Change the docker default timezone from UTC to MSK
RUN echo "Europe/Moscow" > /etc/timezone \
    && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure tzdata

Waiting for other container

command: wait-for rabbitmq:5432 -- script.php

Tag summary

Content type

Image

Digest

sha256:6b823a0e2

Size

62.3 MB

Last updated

almost 4 years ago

docker pull nafigat0r/php-cli