File tree Expand file tree Collapse file tree 10 files changed +228
-1
lines changed
Expand file tree Collapse file tree 10 files changed +228
-1
lines changed Original file line number Diff line number Diff line change 1+ version : 2
2+
3+ updates :
4+ - package-ecosystem : " github-actions"
5+ directory : " /"
6+ schedule :
7+ interval : " daily"
8+
9+ - package-ecosystem : " docker"
10+ directory : " /"
11+ schedule :
12+ interval : " daily"
Original file line number Diff line number Diff line change 1+ name : CI/CD
2+
3+ on : [push, workflow_dispatch]
4+
5+ env :
6+ DOCKER_BUILDKIT : 1
7+
8+ jobs :
9+ build :
10+ name : Build
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout code
15+ 16+
17+ - name : Build
18+ run : |
19+ docker build --pull -t kooldev/php:${{ matrix.version }}-nginx-swoole ${{ matrix.version }}-nginx-swoole
20+ docker build --pull -t kooldev/php:${{ matrix.version }}-nginx-swoole-prod ${{ matrix.version }}-nginx-swoole-prod
21+
22+ - name : Tests
23+ run : |
24+ docker run kooldev/php:${{ matrix.version }}-nginx-swoole php -r "extension_loaded('swoole') or die(1);"
25+ docker run kooldev/php:${{ matrix.version }}-nginx-swoole-prod php -r "extension_loaded('swoole') or die(1);"
26+
27+ - name : Login to DockerHub
28+ 29+ if : github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-swoole'
30+ with :
31+ username : ${{ secrets.DOCKER_USERNAME }}
32+ password : ${{ secrets.DOCKER_PASSWORD }}
33+
34+ - name : Push to DockerHub
35+ if : github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-swoole'
36+ run : |
37+ docker push kooldev/php:${{ matrix.version }}-nginx-swoole
38+ docker push kooldev/php:${{ matrix.version }}-nginx-swoole-prod
Original file line number Diff line number Diff line change 1+ FROM kooldev/php:8.0-nginx-prod
2+
3+ RUN apk add libpq libpq-dev curl-dev
4+
5+ RUN docker-php-ext-install sockets && \
6+ docker-php-source extract && \
7+ mkdir /usr/src/php/ext/swoole && \
8+ curl -sfL https://github.com/swoole/swoole-src/archive/v5.0.1.tar.gz -o swoole.tar.gz && \
9+ tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
10+ docker-php-ext-configure swoole \
11+ --enable-mysqlnd \
12+ --enable-swoole-pgsql \
13+ --enable-openssl \
14+ --enable-sockets --enable-swoole-curl && \
15+ docker-php-ext-install -j$(nproc) swoole
Original file line number Diff line number Diff line change 1+ FROM kooldev/php:8.0-nginx
2+
3+ RUN apk add libpq libpq-dev curl-dev
4+
5+ RUN docker-php-ext-install sockets && \
6+ docker-php-source extract && \
7+ mkdir /usr/src/php/ext/swoole && \
8+ curl -sfL https://github.com/swoole/swoole-src/archive/v5.0.1.tar.gz -o swoole.tar.gz && \
9+ tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
10+ docker-php-ext-configure swoole \
11+ --enable-mysqlnd \
12+ --enable-swoole-pgsql \
13+ --enable-openssl \
14+ --enable-sockets --enable-swoole-curl && \
15+ docker-php-ext-install -j$(nproc) swoole
Original file line number Diff line number Diff line change 1+ FROM kooldev/php:8.1-nginx-prod
2+
3+ RUN apk add libpq libpq-dev curl-dev
4+
5+ RUN docker-php-ext-install sockets && \
6+ docker-php-source extract && \
7+ mkdir /usr/src/php/ext/swoole && \
8+ curl -sfL https://github.com/swoole/swoole-src/archive/v5.0.1.tar.gz -o swoole.tar.gz && \
9+ tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
10+ docker-php-ext-configure swoole \
11+ --enable-mysqlnd \
12+ --enable-swoole-pgsql \
13+ --enable-openssl \
14+ --enable-sockets --enable-swoole-curl && \
15+ docker-php-ext-install -j$(nproc) swoole
Original file line number Diff line number Diff line change 1+ FROM kooldev/php:8.1-nginx
2+
3+ RUN apk add libpq libpq-dev curl-dev
4+
5+ RUN docker-php-ext-install sockets && \
6+ docker-php-source extract && \
7+ mkdir /usr/src/php/ext/swoole && \
8+ curl -sfL https://github.com/swoole/swoole-src/archive/v5.0.1.tar.gz -o swoole.tar.gz && \
9+ tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
10+ docker-php-ext-configure swoole \
11+ --enable-mysqlnd \
12+ --enable-swoole-pgsql \
13+ --enable-openssl \
14+ --enable-sockets --enable-swoole-curl && \
15+ docker-php-ext-install -j$(nproc) swoole
Original file line number Diff line number Diff line change 1- # docker-php-swoole
1+ ## Description
2+
3+ Minimal PHP Docker image with Swoole drive. It's use is intended for [ kool.dev] ( https://github.com/kool-dev/kool ) , but can fit in any other PHP use-case.
4+
5+ This image is based on [ kooldev/php] ( https://github.com/kool-dev/docker-php ) , please refer to that repo README for further documentation.
6+
7+ ## Available Tags
8+
9+ ### 8.0
10+
11+ - [ 8.0-nginx-swoole] ( https://github.com/kool-dev/docker-php-swoole/blob/main/8.0-nginx-swoole/Dockerfile )
12+ - [ 8.0-nginx-swoole-prod] ( https://github.com/kool-dev/docker-php-swoole/blob/main/8.0-nginx-swoole-prod/Dockerfile )
13+
14+
15+ ### 8.1
16+
17+ - [ 8.1-nginx-swoole] ( https://github.com/kool-dev/docker-php-swoole/blob/main/8.1-nginx-swoole/Dockerfile )
18+ - [ 8.1-nginx-swoole-prod] ( https://github.com/kool-dev/docker-php-swoole/blob/main/8.1-nginx-swoole-prod/Dockerfile )
19+
20+
21+ ## Environment Variables
22+
23+ Please refer to [ kooldev/php] ( https://github.com/kool-dev/docker-php ) .
24+
25+ ### NGINX
26+
27+ Please refer to [ kooldev/php] ( https://github.com/kool-dev/docker-php ) .
28+
29+ ## Usage
30+
31+ Please refer to [ kooldev/php] ( https://github.com/kool-dev/docker-php ) .
32+
33+ ## Contributing
34+
35+ ### Update images with templates
36+
37+ The Dockerfile's are automatically managed by ` fwd-template.json ` configuration file and files in the ` template ` folder. We should always make changes directly to these files.
38+
39+ After any changes, we need to run ` kool run template ` to parse the templates and generate folder/files for each version.
40+
41+ ## License
42+
43+ The MIT License (MIT). Please see [ License File] ( LICENSE.md ) for more information.
Original file line number Diff line number Diff line change 1+ {
2+ "output" : " ." ,
3+ "builds" : [
4+ {
5+ "name" : " 8.0-nginx-swoole" ,
6+ "data" : {
7+ "from" : " kooldev/php:8.0-nginx"
8+ },
9+ "files" : [
10+ {
11+ "name" : " Dockerfile" ,
12+ "path" : " template/Dockerfile"
13+ }
14+ ]
15+ },
16+ {
17+ "name" : " 8.0-nginx-swoole-prod" ,
18+ "data" : {
19+ "from" : " kooldev/php:8.0-nginx-prod"
20+ },
21+ "files" : [
22+ {
23+ "name" : " Dockerfile" ,
24+ "path" : " template/Dockerfile"
25+ }
26+ ]
27+ },
28+ {
29+ "name" : " 8.1-nginx-swoole" ,
30+ "data" : {
31+ "from" : " kooldev/php:8.1-nginx"
32+ },
33+ "files" : [
34+ {
35+ "name" : " Dockerfile" ,
36+ "path" : " template/Dockerfile"
37+ }
38+ ]
39+ },
40+ {
41+ "name" : " 8.1-nginx-swoole-prod" ,
42+ "data" : {
43+ "from" : " kooldev/php:8.1-nginx-prod"
44+ },
45+ "files" : [
46+ {
47+ "name" : " Dockerfile" ,
48+ "path" : " template/Dockerfile"
49+ }
50+ ]
51+ }
52+ ]
53+ }
Original file line number Diff line number Diff line change 1+ scripts :
2+ template :
3+ - kool docker fireworkweb/fwd:v1.0 fwd template
4+ build :
5+ - kool run template
6+ - docker build --pull -t kooldev/php:8.0-nginx-swoole 8.0-nginx-swoole
7+ - docker build --pull -t kooldev/php:8.0-nginx-swoole-prod 8.0-nginx-swoole-prod
Original file line number Diff line number Diff line change 1+ FROM {{ $from } }
2+
3+ RUN apk add libpq libpq-dev curl-dev
4+
5+ RUN docker-php-ext-install sockets && \
6+ docker-php-source extract && \
7+ mkdir /usr/src/php/ext/swoole && \
8+ curl -sfL https://github.com/swoole/swoole-src/archive/v5.0.1.tar.gz -o swoole.tar.gz && \
9+ tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
10+ docker-php-ext-configure swoole \
11+ --enable-mysqlnd \
12+ --enable-swoole-pgsql \
13+ --enable-openssl \
14+ --enable-sockets --enable-swoole-curl && \
15+ docker-php-ext-install -j$(nproc) swoole
You can’t perform that action at this time.
0 commit comments