Compare commits
No commits in common. "2f18130e72fec818fa017ea043574053c13d4dbe" and "da2149cb60f21764359373f9e53b1126a6ae3bc7" have entirely different histories.
2f18130e72
...
da2149cb60
66
Dockerfile
66
Dockerfile
@ -1,4 +1,4 @@
|
||||
FROM php:8.2-fpm-alpine AS chill_base_php82
|
||||
FROM php:7.4-fpm-buster AS chill_base_php
|
||||
|
||||
ENV POSTGRES_VERSION 14
|
||||
|
||||
@ -6,31 +6,27 @@ ENV POSTGRES_VERSION 14
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
|
||||
# install php extensions and deps
|
||||
RUN apk update && apk add --no-cache \
|
||||
wget gnupg \
|
||||
libpq-dev \
|
||||
icu-dev icu-libs icu-data-full \
|
||||
oniguruma-dev \
|
||||
libzip libzip-dev \
|
||||
linux-headers \
|
||||
gcc g++ make autoconf \
|
||||
bash git \
|
||||
&& docker-php-ext-install pdo_pgsql intl mbstring zip bcmath exif sockets \
|
||||
&& git clone https://github.com/nikic/php-ast.git \
|
||||
&& cd php-ast \
|
||||
&& phpize \
|
||||
&& ./configure \
|
||||
&& make install \
|
||||
&& echo 'extension=ast.so' > /usr/local/etc/php/php.ini \
|
||||
&& cd .. && rm -rf php-ast \
|
||||
&& pecl install redis \
|
||||
&& docker-php-ext-enable redis \
|
||||
&& apk add libpng-dev libjpeg-turbo-dev freetype-dev \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j$(nproc) gd \
|
||||
&& apk add postgresql${POSTGRES_VERSION}-client \
|
||||
&& apk del --purge wget gnupg libpq-dev icu-dev oniguruma-dev libzip-dev linux-headers gcc g++ make autoconf
|
||||
RUN apt update && apt -y --no-install-recommends install wget gnupg \
|
||||
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
|
||||
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
|
||||
&& apt update && apt -y --no-install-recommends install \
|
||||
libicu-dev \
|
||||
g++ \
|
||||
postgresql-server-dev-$POSTGRES_VERSION \
|
||||
libzip-dev libzip4 unzip \
|
||||
libfreetype6-dev \
|
||||
libonig-dev `# install oniguruma, required for mbstring` \
|
||||
libpng-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
git \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j$(nproc) gd \
|
||||
&& docker-php-ext-install intl pdo_pgsql mbstring zip bcmath sockets exif \
|
||||
&& pecl install redis \
|
||||
&& docker-php-ext-enable redis \
|
||||
&& apt remove -y wget libicu-dev g++ gnupg libzip-dev \
|
||||
&& apt autoremove -y \
|
||||
&& apt purge -y
|
||||
|
||||
RUN { \
|
||||
echo ""; \
|
||||
@ -45,31 +41,15 @@ RUN { \
|
||||
echo ""; \
|
||||
} >> /usr/local/etc/php/conf.d/date.ini
|
||||
|
||||
# temporary fix, while php-cs-fixer has conflict dependencies
|
||||
# with chill
|
||||
RUN curl -o /usr/local/bin/php-cs-fixer https://cs.symfony.com/download/php-cs-fixer-v3.phar \
|
||||
&& chmod +x /usr/local/bin/php-cs-fixer
|
||||
# to make php-cs-fixer works with php 8.2
|
||||
ENV PHP_CS_FIXER_IGNORE_ENV=1
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
ENV COMPOSER_ALLOW_SUPERUSER=1
|
||||
ENV COMPOSER_MEMORY_LIMIT=-1
|
||||
|
||||
# shell bash preference
|
||||
RUN sed -i " \
|
||||
s|root:x:0:0:root:/root:/bin/ash|root:x:0:0:root:/root:/bin/bash|g; \
|
||||
s|postgres:x:70:70:PostgreSQL user:/var/lib/postgresql:/bin/sh|postgres:x:70:70:PostgreSQL user:/var/lib/postgresql:/bin/bash|g" \
|
||||
/etc/passwd
|
||||
|
||||
# chmod on redis.so
|
||||
RUN chmod 755 -R /usr/local/lib/php/extensions/
|
||||
|
||||
WORKDIR /var/www/app
|
||||
|
||||
CMD ["php-fpm"]
|
||||
|
||||
FROM chill_base_php82 AS chill_php82
|
||||
FROM chill_base_php AS chill_php
|
||||
|
||||
# copy directories
|
||||
|
||||
|
8
Makefile
8
Makefile
@ -2,12 +2,12 @@ THIS_FILE := $(lastword $(MAKEFILE_LIST))
|
||||
PWD:=$(shell echo ${PWD})
|
||||
UID:=$(shell id -u)
|
||||
GID:=$(shell id -g)
|
||||
BASE_TAG=chill_base_php82
|
||||
BASE_TAG=chill_base_php
|
||||
DOCKERNODE_CMD=docker run --rm --user ${UID}:${GID} -v ${PWD}:/app --workdir /app -e YARN_CACHE_FOLDER=/app/.yarncache node:16
|
||||
DOCKER_COMPOSE_PHP_EXEC_CMD=docker-compose run --rm --user $(UID):$(GID) -e CLEAR_CACHE=false -e COMPOSER_HOME=/var/www/app/.composer --entrypoint /usr/bin/env php
|
||||
DOCKER_PHP_EXEC_CMD_BASE=docker run --rm --user $(UID):$(GID) -v ${PWD}:/var/www/app -e CLEAR_CACHE=false -e COMPOSER_HOME=/var/www/app/.composer --entrypoint /usr/bin/env $(BASE_TAG)
|
||||
PHP_BASE_IMAGE=php:8.2-fpm-alpine
|
||||
PHP_BASE_IMAGE_CHILL=chill_php82
|
||||
PHP_BASE_IMAGE=php:7.4-fpm-buster
|
||||
PHP_BASE_IMAGE_CHILL=chill_base_php
|
||||
NGINX_BASE_IMAGE=nginx
|
||||
CALVER=$(shell date "+v%Y%m%d%H%M")-${CALVERSION}
|
||||
ifneq (,$(wildcard ./.env))
|
||||
@ -39,7 +39,7 @@ build-assets:
|
||||
$(DOCKERNODE_CMD) yarn run encore production
|
||||
|
||||
init:
|
||||
docker build --target $(PHP_BASE_IMAGE_CHILL) -t $(BASE_TAG) .
|
||||
docker build --target chill_base_php -t $(BASE_TAG) .
|
||||
$(DOCKER_PHP_EXEC_CMD_BASE) composer update --no-scripts --no-interaction
|
||||
@$(MAKE) -f $(THIS_FILE) build-assets
|
||||
@$(MAKE) -f $(THIS_FILE) post-install
|
||||
|
@ -8,7 +8,7 @@ services:
|
||||
args:
|
||||
UID: ${PHP_FPM_USER:-1000}
|
||||
# uncomment and set your own image if needed
|
||||
image: ${IMAGE_PHP-chill_php82}:${VERSION:-latest}
|
||||
image: ${IMAGE_PHP-chill_php}:${VERSION:-latest}
|
||||
volumes:
|
||||
- .:/var/www/app
|
||||
environment:
|
||||
|
@ -10,7 +10,7 @@ services:
|
||||
args:
|
||||
UID: ${PHP_FPM_USER:-1000}
|
||||
# uncomment and set your own image if needed
|
||||
image: ${IMAGE_PHP-chill_php82}:${VERSION:-latest}
|
||||
image: ${IMAGE_PHP-chill_php}:${VERSION:-latest}
|
||||
#
|
||||
# normally, you should not mount any volume and use your own image
|
||||
#
|
||||
|
@ -8,7 +8,7 @@ services:
|
||||
args:
|
||||
UID: ${PHP_FPM_USER:-1000}
|
||||
# uncomment and set your own image if needed
|
||||
image: ${IMAGE_PHP:-chill_php82}:${VERSION:-latest}
|
||||
image: ${IMAGE_PHP:-chill_php}:${VERSION:-latest}
|
||||
volumes:
|
||||
- .:/var/www/app
|
||||
environment:
|
||||
|
Loading…
Reference in New Issue
Block a user