Skip to content

Commit

Permalink
8.2-node updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciojs committed Oct 25, 2023
1 parent 84341da commit 670abce
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 223 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ jobs:
load: true
tags: kooldev/php:${{ matrix.version }}-nginx${{ matrix.type }}

- name: Build and export to Docker (Node)
uses: docker/build-push-action@v5
if: ${{ matrix.type }} == ''
with:
context: ${{ matrix.version }}-node${{ matrix.type }}
load: true
tags: kooldev/php:${{ matrix.version }}-node${{ matrix.type }}

- name: Tests (nginx)
run: |
docker run kooldev/php:${{ matrix.version }}-nginx${{ matrix.type }} php -v
Expand Down
4 changes: 4 additions & 0 deletions 8.0-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM kooldev/php:8.0

RUN apk add --update --no-cache npm yarn \
&& rm -rf /var/cache/apk/* /tmp/*
4 changes: 4 additions & 0 deletions 8.1-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM kooldev/php:8.1

RUN apk add --update --no-cache npm yarn \
&& rm -rf /var/cache/apk/* /tmp/*
83 changes: 2 additions & 81 deletions 8.2-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,83 +1,4 @@
FROM php:8.2-fpm-alpine
FROM kooldev/php:8.2

ENV ASUSER= \
UID= \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
ENABLE_XDEBUG=false \
PHP_DATE_TIMEZONE=UTC \
PHP_MEMORY_LIMIT=256M \
PHP_MAX_INPUT_VARS=1000 \
PHP_UPLOAD_MAX_FILESIZE=25M \
PHP_POST_MAX_SIZE=25M \
PHP_MAX_EXECUTION_TIME=30 \
PHP_FPM_LISTEN=9000 \
PHP_FPM_MAX_CHILDREN=10 \
PHP_FPM_REQUEST_TERMINATE_TIMEOUT=60 \
ENTRYPOINT=entrypoint.php.sh

WORKDIR /app

RUN adduser -D -u 1337 kool \
&& addgroup kool www-data \
# dockerize
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
&& mv dockerize /usr/local/bin/dockerize \
# deps
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
jpegoptim optipng pngquant gifsicle libldap \
libpq less \
# build-deps
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
calendar \
exif \
gd \
intl \
ldap \
mbstring \
pcntl \
pdo \
pdo_mysql \
pdo_pgsql \
soap \
xml \
zip \
sockets \
mysqli \
&& pecl install imagick redis \
&& pecl install xdebug \
&& pecl install pcov && docker-php-ext-enable pcov \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable redis \
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
# composer
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& curl -sS https://getcomposer.org/installer | php -- --1 --install-dir=/usr/local/bin --filename=composer1 \
# symlink composer2 for BC
&& ln -s /usr/local/bin/composer /usr/local/bin/composer2 \
# cleanup
&& apk del .build-deps \
RUN apk add --update --no-cache npm yarn \
&& rm -rf /var/cache/apk/* /tmp/*

RUN apk add --update --no-cache npm

COPY kool.ini /kool/kool.tmpl
COPY zz-docker.conf /kool/zz-docker.tmpl
COPY entrypoint /kool/entrypoint
RUN chmod +x /kool/entrypoint

EXPOSE 9000

ENTRYPOINT [ "/kool/entrypoint" ]
CMD [ "php-fpm" ]
33 changes: 0 additions & 33 deletions 8.2-node/entrypoint

This file was deleted.

29 changes: 0 additions & 29 deletions 8.2-node/kool.ini

This file was deleted.

48 changes: 0 additions & 48 deletions 8.2-node/zz-docker.conf

This file was deleted.

57 changes: 34 additions & 23 deletions fwd-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@
}
]
},
{
"name": "8.0-node",
"data": {
"from": "kooldev/php:8.0",
"version": "8.0"
},
"files": [
{
"name": "Dockerfile",
"path": "template/Dockerfile-node"
}
]
},
{
"name": "8.1",
"data": {
Expand Down Expand Up @@ -218,37 +231,23 @@
]
},
{
"name": "8.2",
"name": "8.1-node",
"data": {
"from": "php:8.2-fpm-alpine",
"prod": false,
"nginx": false,
"version": "8.2"
"from": "kooldev/php:8.1",
"version": "8.1"
},
"files": [
{
"name": "Dockerfile",
"path": "template/Dockerfile"
},
{
"name": "entrypoint",
"path": "template/entrypoint"
},
{
"name": "kool.ini",
"path": "template/kool-ini"
},
{
"name": "zz-docker.conf",
"path": "template/zz-docker-conf"
"path": "template/Dockerfile-node"
}
]
},
{
"name": "8.2-prod",
"name": "8.2",
"data": {
"from": "php:8.2-fpm-alpine",
"prod": true,
"prod": false,
"nginx": false,
"version": "8.2"
},
Expand All @@ -272,11 +271,10 @@
]
},
{
"name": "8.2-node",
"name": "8.2-prod",
"data": {
"from": "php:8.2-fpm-alpine",
"with_node": true,
"prod": false,
"prod": true,
"nginx": false,
"version": "8.2"
},
Expand Down Expand Up @@ -352,6 +350,19 @@
"path": "template/supervisor-conf"
}
]
},
{
"name": "8.2-node",
"data": {
"from": "kooldev/php:8.2",
"version": "8.2"
},
"files": [
{
"name": "Dockerfile",
"path": "template/Dockerfile-node"
}
]
}
]
}
12 changes: 7 additions & 5 deletions kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ scripts:
- docker build --pull -t kooldev/php:8.0-prod 8.0-prod
- docker build -t kooldev/php:8.0-nginx 8.0-nginx
- docker build -t kooldev/php:8.0-nginx-prod 8.0-nginx-prod
- docker build -t kooldev/php:8.0-node 8.0-node
build-8.1:
- docker build --pull -t kooldev/php:8.1 8.1
- docker build --pull -t kooldev/php:8.1-prod 8.1-prod
- docker build -t kooldev/php:8.1 8.1
- docker build -t kooldev/php:8.1-prod 8.1-prod
- docker build -t kooldev/php:8.1-nginx 8.1-nginx
- docker build -t kooldev/php:8.1-nginx-prod 8.1-nginx-prod
- docker build -t kooldev/php:8.1-node 8.1-node
build-8.2:
- docker build --pull -t kooldev/php:8.2 8.2
- docker build --pull -t kooldev/php:8.2-prod 8.2-prod
- docker build --pull -t kooldev/php:8.2-node 8.2-node
- docker build -t kooldev/php:8.2 8.2
- docker build -t kooldev/php:8.2-prod 8.2-prod
- docker build -t kooldev/php:8.2-nginx 8.2-nginx
- docker build -t kooldev/php:8.2-nginx-prod 8.2-nginx-prod
- docker build -t kooldev/php:8.2-node 8.2-node
build:
# parse templates
- kool run template
Expand Down
4 changes: 4 additions & 0 deletions template/Dockerfile-node.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM {{ $from }}

RUN apk add --update --no-cache npm yarn \
&& rm -rf /var/cache/apk/* /tmp/*
4 changes: 0 additions & 4 deletions template/Dockerfile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* /tmp/*

@if ($with_node ?? false)
RUN apk add --update --no-cache npm

@endif
COPY kool.ini /kool/kool.tmpl
COPY zz-docker.conf /kool/zz-docker.tmpl
COPY entrypoint /kool/entrypoint
Expand Down

0 comments on commit 670abce

Please sign in to comment.