-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ed19f5
commit d43a869
Showing
4 changed files
with
106 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build Docker FrankenPHP image | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- '*' | ||
paths: | ||
- .gitattributes | ||
- .github/workflows/build-and-publish-franken-image.yml | ||
- docker/franken-image/Dockerfile | ||
- composer.* | ||
- src/** | ||
|
||
env: | ||
IMAGE_NAME: db-tools-bundle | ||
|
||
jobs: | ||
build-and-push-image: | ||
name: Push Docker FrankenPHP image to Docker Hub | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: makinacorpus/db-tools-bundle | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | ||
with: | ||
context: . | ||
file: docker/franken-image/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags == 'main' && 'unstable' || steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM dunglas/frankenphp:1-php8.3 | ||
ARG TAG=dev-main | ||
ARG EXTRA_COMPOSER_REQUIREMENTS='' | ||
|
||
# Basic requirements | ||
RUN apt-get update | ||
RUN apt-get install -yqq --no-install-recommends default-mysql-client acl iproute2 zip zlib1g-dev libzip-dev \ | ||
libxml2-dev libpng-dev libghc-curl-dev libldb-dev libldap2-dev gnupg2 libpq-dev sqlite3 | ||
|
||
# Installing postgresql-client-16 | ||
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc| gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg && \ | ||
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ | ||
apt-get update && apt-get install -y postgresql-16 | ||
|
||
# PHP required extensions | ||
RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql | ||
RUN docker-php-ext-install -j$(nproc) pgsql pdo_pgsql pdo mysqli pdo_mysql zip xml gd curl bcmath | ||
RUN docker-php-ext-enable pdo_pgsql pdo_mysql sodium | ||
|
||
# SQL Server support | ||
ENV ACCEPT_EULA=Y | ||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | ||
RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list | ||
RUN apt-get update | ||
RUN apt-get -y --no-install-recommends install msodbcsql18 unixodbc-dev | ||
RUN pecl install sqlsrv | ||
RUN pecl install pdo_sqlsrv | ||
RUN docker-php-ext-enable sqlsrv pdo_sqlsrv | ||
|
||
# Cleanup. | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
WORKDIR /var/www | ||
|
||
RUN composer require \ | ||
makinacorpus/db-tools-bundle:$TAG \ | ||
symfony/password-hasher:* \ | ||
# TODO uncomment these lines when those packages | ||
# will have a compatible version available | ||
# on packagist | ||
# db-tools-bundle/pack-fr-fr:$TAG \ | ||
# db-tools-bundle/pack-faker:$TAG \ | ||
$EXTRA_COMPOSER_REQUIREMENTS | ||
|
||
ENTRYPOINT ["/var/www/vendor/bin/db-tools"] |