diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8cc5fa7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +ARG PHP_VERSION=8.2.7 + +FROM php:${PHP_VERSION} + +ENV DEBIAN_FRONTEND noninteractive +ENV DOCKER_PHP_DEPS \ + libxml2-dev \ + libzip-dev \ + unzip + +RUN set -xe; \ + apt-get --allow-releaseinfo-change update && \ + apt-get install -y -qq ${DOCKER_PHP_DEPS} --no-install-suggests --no-install-recommends && \ + docker-php-ext-install -j$(nproc) xml && \ + docker-php-ext-install -j$(nproc) zip && \ + rm -rf /var/lib/apt/lists/* && \ + apt-get clean + +WORKDIR /app + +COPY ./ ./ diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..b40a55d --- /dev/null +++ b/compose.yml @@ -0,0 +1,8 @@ +services: + php-fpm: + build: + context: ./ + dockerfile: ./Dockerfile + entrypoint: [ '/app/docker-entrypoint.sh' ] + volumes: + - .:/app diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..30fff57 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +echo "Start PHP image" + +# Define of php path +PHP_FPM=$(which php-fpm) + +${PHP_FPM} --nodaemonize diff --git a/local_development.md b/local_development.md new file mode 100644 index 0000000..7a58ace --- /dev/null +++ b/local_development.md @@ -0,0 +1,27 @@ +# Local Development + +You can use Docker as alternative for the locally installed tools. +There is a [Dockerfile](Dockerfile) provided for the calling of shell scripts. + +**Pre conditions:** +- Docker should be installed. +- You familiar and can to call shell scripts. + +First of all, you have to build container locally. + +```shell +docker build -t phario:local . +``` + +The next step. Run container. + +```shell +docker run -ti phario:local bash +``` + +## Updating of Repositories List + +1. Provide an alias of your project when it's composer name don't match pattern `/`. + Add it into file of [repository](data/repositories.xml). +2. It should be added it alphabetical order. So, you can just add it in any place + and then call [script](scripts/order-repos/order) which order repositories for you.