Skip to content

Commit d43a869

Browse files
Add docker frankenPHP cli image
1 parent 6ed19f5 commit d43a869

File tree

4 files changed

+106
-9
lines changed

4 files changed

+106
-9
lines changed

.github/workflows/build-and-publish-image.yml renamed to .github/workflows/build-and-publish-ci-image.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Docker image
1+
name: Build Docker CI image
22

33
on:
44
push:
@@ -14,7 +14,7 @@ env:
1414

1515
jobs:
1616
build-and-push-image:
17-
name: Push Docker image to Docker Hub
17+
name: Push Docker CI image to Docker Hub
1818
runs-on: ubuntu-latest
1919
permissions:
2020
contents: read
@@ -34,7 +34,7 @@ jobs:
3434
id: meta
3535
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
3636
with:
37-
images: simonmellerin/db-tools-bundle-ci
37+
images: makinacorpus/db-tools-bundle-ci
3838

3939
- name: Build and push Docker image
4040
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build Docker FrankenPHP image
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- '*'
9+
paths:
10+
- .gitattributes
11+
- .github/workflows/build-and-publish-franken-image.yml
12+
- docker/franken-image/Dockerfile
13+
- composer.*
14+
- src/**
15+
16+
env:
17+
IMAGE_NAME: db-tools-bundle
18+
19+
jobs:
20+
build-and-push-image:
21+
name: Push Docker FrankenPHP image to Docker Hub
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
27+
steps:
28+
- name: Check out the repo
29+
uses: actions/checkout@v4
30+
31+
- name: Log in to Docker Hub
32+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
33+
with:
34+
username: ${{ secrets.DOCKER_USERNAME }}
35+
password: ${{ secrets.DOCKER_PASSWORD }}
36+
37+
- name: Extract metadata (tags, labels) for Docker
38+
id: meta
39+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
40+
with:
41+
images: makinacorpus/db-tools-bundle
42+
43+
- name: Build and push Docker image
44+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
45+
with:
46+
context: .
47+
file: docker/franken-image/Dockerfile
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags == 'main' && 'unstable' || steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/continuous-integration.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
name: "PHPUnit with PHP version matrix"
2525
runs-on: ubuntu-latest
2626
container:
27-
image: simonmellerin/db-tools-bundle-ci:main
27+
image: makinacorpus/db-tools-bundle-ci:main
2828

2929
strategy:
3030
matrix:
@@ -89,7 +89,7 @@ jobs:
8989
name: "PHPUnit with PostgreSQL"
9090
runs-on: ubuntu-latest
9191
container:
92-
image: simonmellerin/db-tools-bundle-ci:main
92+
image: makinacorpus/db-tools-bundle-ci:main
9393
needs: "phpunit-smoke-tests"
9494

9595
strategy:
@@ -152,7 +152,7 @@ jobs:
152152
name: "PHPUnit with MariaDB"
153153
runs-on: ubuntu-latest
154154
container:
155-
image: simonmellerin/db-tools-bundle-ci:main
155+
image: makinacorpus/db-tools-bundle-ci:main
156156
needs: "phpunit-smoke-tests"
157157

158158
strategy:
@@ -218,7 +218,7 @@ jobs:
218218
name: "PHPUnit with MySQL"
219219
runs-on: ubuntu-latest
220220
container:
221-
image: simonmellerin/db-tools-bundle-ci:main
221+
image: makinacorpus/db-tools-bundle-ci:main
222222
needs: "phpunit-smoke-tests"
223223

224224
strategy:
@@ -283,7 +283,7 @@ jobs:
283283
# name: "PHPUnit with SQL Server"
284284
# runs-on: ubuntu-latest
285285
# container:
286-
# image: simonmellerin/db-tools-bundle-ci:main
286+
# image: makinacorpus/db-tools-bundle-ci:main
287287
# needs: "phpunit-smoke-tests"
288288

289289
# strategy:
@@ -346,7 +346,7 @@ jobs:
346346
name: "PHPUnit with SQLite"
347347
runs-on: ubuntu-latest
348348
container:
349-
image: simonmellerin/db-tools-bundle-ci:main
349+
image: makinacorpus/db-tools-bundle-ci:main
350350
needs: "phpunit-smoke-tests"
351351

352352
strategy:

docker/franken-image/Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM dunglas/frankenphp:1-php8.3
2+
ARG TAG=dev-main
3+
ARG EXTRA_COMPOSER_REQUIREMENTS=''
4+
5+
# Basic requirements
6+
RUN apt-get update
7+
RUN apt-get install -yqq --no-install-recommends default-mysql-client acl iproute2 zip zlib1g-dev libzip-dev \
8+
libxml2-dev libpng-dev libghc-curl-dev libldb-dev libldap2-dev gnupg2 libpq-dev sqlite3
9+
10+
# Installing postgresql-client-16
11+
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc| gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg && \
12+
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
13+
apt-get update && apt-get install -y postgresql-16
14+
15+
# PHP required extensions
16+
RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql
17+
RUN docker-php-ext-install -j$(nproc) pgsql pdo_pgsql pdo mysqli pdo_mysql zip xml gd curl bcmath
18+
RUN docker-php-ext-enable pdo_pgsql pdo_mysql sodium
19+
20+
# SQL Server support
21+
ENV ACCEPT_EULA=Y
22+
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
23+
RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
24+
RUN apt-get update
25+
RUN apt-get -y --no-install-recommends install msodbcsql18 unixodbc-dev
26+
RUN pecl install sqlsrv
27+
RUN pecl install pdo_sqlsrv
28+
RUN docker-php-ext-enable sqlsrv pdo_sqlsrv
29+
30+
# Cleanup.
31+
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
32+
33+
COPY --from=composer /usr/bin/composer /usr/bin/composer
34+
35+
WORKDIR /var/www
36+
37+
RUN composer require \
38+
makinacorpus/db-tools-bundle:$TAG \
39+
symfony/password-hasher:* \
40+
# TODO uncomment these lines when those packages
41+
# will have a compatible version available
42+
# on packagist
43+
# db-tools-bundle/pack-fr-fr:$TAG \
44+
# db-tools-bundle/pack-faker:$TAG \
45+
$EXTRA_COMPOSER_REQUIREMENTS
46+
47+
ENTRYPOINT ["/var/www/vendor/bin/db-tools"]

0 commit comments

Comments
 (0)