Skip to content

Commit

Permalink
PHP 8.3 with ext-pdo_sqlsrv
Browse files Browse the repository at this point in the history
  • Loading branch information
boboldehampsink committed Aug 20, 2024
1 parent cfdb416 commit 9401839
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Which versions?
ARG PHP_VERSION=8.3.10
ARG PDO_SQLSRV_EXT_VERSION=5.12.0
ARG REDIS_EXT_VERSION=6.0.2
ARG IMAGICK_EXT_VERSION=3.7.0
ARG PCOV_EXT_VERSION=1.0.11
Expand All @@ -12,6 +13,7 @@ ARG YARN_VERSION=1.22.22
# Inherit from Heroku's stack
FROM --platform=linux/amd64 robuust/heroku:22 as stage-amd64
ARG PHP_VERSION
ARG PDO_SQLSRV_EXT_VERSION
ARG REDIS_EXT_VERSION
ARG IMAGICK_EXT_VERSION
ARG PCOV_EXT_VERSION
Expand All @@ -36,6 +38,7 @@ RUN curl --silent --location https://lang-php.s3.us-east-1.amazonaws.com/dist-he
RUN curl --silent --location https://lang-php.s3.us-east-1.amazonaws.com/dist-heroku-22-stable/extensions/no-debug-non-zts-20230831/redis-$REDIS_EXT_VERSION.tar.gz | tar xz -C /app/.heroku/php
RUN curl --silent --location https://lang-php.s3.us-east-1.amazonaws.com/dist-heroku-22-stable/extensions/no-debug-non-zts-20230831/imagick-$IMAGICK_EXT_VERSION.tar.gz | tar xz -C /app/.heroku/php
RUN curl --silent --location https://lang-php.s3.us-east-1.amazonaws.com/dist-heroku-22-stable/extensions/no-debug-non-zts-20230831/pcov-$PCOV_EXT_VERSION.tar.gz | tar xz -C /app/.heroku/php
RUN curl --silent --location https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/extensions/no-debug-non-zts-20230831/pdo_sqlsrv-$PDO_SQLSRV_EXT_VERSION-x86.tar.gz | tar xz -C /app/.heroku/php

# Install Composer
RUN curl --silent --location https://lang-php.s3.us-east-1.amazonaws.com/dist-heroku-22-stable/composer-$COMPOSER_VERSION.tar.gz | tar xz -C /app/.heroku/php
Expand All @@ -46,6 +49,7 @@ RUN curl --silent --location https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_
# Inherit from Heroku's stack
FROM --platform=linux/arm64 robuust/heroku:22 as stage-arm64
ARG PHP_VERSION
ARG PDO_SQLSRV_EXT_VERSION
ARG REDIS_EXT_VERSION
ARG IMAGICK_EXT_VERSION
ARG PCOV_EXT_VERSION
Expand All @@ -70,6 +74,7 @@ RUN curl --silent --location https://robuust-heroku-php.s3.eu-west-1.amazonaws.c
RUN curl --silent --location https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/extensions/no-debug-non-zts-20230831/redis-$REDIS_EXT_VERSION.tar.gz | tar xz -C /app/.heroku/php
RUN curl --silent --location https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/extensions/no-debug-non-zts-20230831/imagick-$IMAGICK_EXT_VERSION.tar.gz | tar xz -C /app/.heroku/php
RUN curl --silent --location https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/extensions/no-debug-non-zts-20230831/pcov-$PCOV_EXT_VERSION.tar.gz | tar xz -C /app/.heroku/php
RUN curl --silent --location https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/extensions/no-debug-non-zts-20230831/pdo_sqlsrv-$PDO_SQLSRV_EXT_VERSION.tar.gz | tar xz -C /app/.heroku/php

# Install Composer
RUN curl --silent --location https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/composer-$COMPOSER_VERSION.tar.gz | tar xz -C /app/.heroku/php
Expand All @@ -86,7 +91,13 @@ LABEL maintainer="Bob Olde Hampsink <[email protected]>"
ENV PORT 3000

# Locate our binaries
ENV PATH /app/.heroku/php/bin:/app/.heroku/php/sbin:/app/.heroku/node/bin/:/app/user/node_modules/.bin:/app/user/vendor/bin:/app/user/:$PATH
ENV PATH /app/.heroku/php/bin:/app/.heroku/php/sbin:/app/.heroku/node/bin/:/app/user/node_modules/.bin:/app/user/vendor/bin:/app/user:/opt/mssql-tools18/bin:$PATH

# Install Microsoft ODBC driver, MSSQL tools and unixODBC development headers
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update -qqy \
&& ACCEPT_EULA=Y apt-get -qqy install msodbcsql18 mssql-tools18 unixodbc-dev

# Apache Config
RUN curl --silent --location https://raw.githubusercontent.com/heroku/heroku-buildpack-php/master/support/build/_conf/apache2/httpd.conf > /app/.heroku/php/etc/apache2/httpd.conf
Expand Down Expand Up @@ -118,6 +129,7 @@ extension=gettext.so \n\
extension=intl.so \n\
extension=mbstring.so \n\
extension=pcntl.so \n\
extension=pdo_sqlsrv.so \n\
extension=pcov.so \n\
extension=redis.so \n\
extension=imagick.so \n\
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Docker image for Heroku PHP

Usage: `FROM ghcr.io/robuust/heroku-php`
Usage: `FROM ghcr.io/robuust/heroku-php:pdo_sqlsrv`

# Specifications

* Heroku 22
* Apache
* Nginx
* PHP 8.3.x with Redis, Imagick and PCov
* PHP 8.3.x with Redis, Imagick, PCov and PDO SQL Server
* Composer 2
* Node 20.x
* Yarn
Expand Down
55 changes: 55 additions & 0 deletions packages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"packages": [
[
{
"name": "heroku-sys/ext-pdo_sqlsrv",
"version": "5.12.0",
"type": "heroku-sys-php-extension",
"require": {
"heroku-sys/heroku": "^22.0.0",
"heroku-sys/php": "8.3.*",
"heroku/installer-plugin": "^1.2.0"
},
"dist": {
"type": "heroku-sys-tar",
"url": "https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/extensions/no-debug-non-zts-20230831/pdo_sqlsrv-5.12.0-x86.tar.gz"
},
"time": "2024-02-01 15:31:30"
}
],
[
{
"name": "heroku-sys/ext-pdo_sqlsrv",
"version": "5.12.0",
"type": "heroku-sys-php-extension",
"require": {
"heroku-sys/heroku": "^22.0.0",
"heroku-sys/php": "8.2.*",
"heroku/installer-plugin": "^1.2.0"
},
"dist": {
"type": "heroku-sys-tar",
"url": "https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/extensions/no-debug-non-zts-20220829/pdo_sqlsrv-5.12.0-x86.tar.gz"
},
"time": "2024-02-01 15:31:30"
}
],
[
{
"name": "heroku-sys/ext-pdo_sqlsrv",
"version": "5.12.0",
"type": "heroku-sys-php-extension",
"require": {
"heroku-sys/heroku": "^22.0.0",
"heroku-sys/php": "8.1.*",
"heroku/installer-plugin": "^1.2.0"
},
"dist": {
"type": "heroku-sys-tar",
"url": "https://robuust-heroku-php.s3.eu-west-1.amazonaws.com/dist-heroku-22-develop/extensions/no-debug-non-zts-20210902/pdo_sqlsrv-5.12.0-x86.tar.gz"
},
"time": "2024-02-01 15:31:30"
}
]
]
}

0 comments on commit 9401839

Please sign in to comment.