Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ RewriteRule "^search(/1\.0)?" "/script/search/1.0/search.php" [END]

#### Rewrites for /script folder: /keyboard

RewriteRule "^keyboard/(.*)$" "/script/keyboard/keyboard.php?id=$1" [END]
RewriteRule "^keyboard/(.*)$" "/script/keyboard/keyboard.php?id=$1" [BCTLS,END]

#### Rewrites for /script folder: /increment-download

RewriteRule "^increment-download/(.*)$" "/script/increment-download/increment-download.php?id=$1" [END]
RewriteRule "^increment-download/(.*)$" "/script/increment-download/increment-download.php?id=$1" [BCTLS,END]

#### Rewrites for /script folder: /app-downloads-increment

RewriteRule "^app-downloads-increment/([^/]+)/([^/]+)/(.*)$" "/script/app-downloads-increment/app-downloads-increment.php?product=$1&version=$2&tier=$3" [END]
RewriteRule "^app-downloads-increment/([^/]+)/([^/]+)/(.*)$" "/script/app-downloads-increment/app-downloads-increment.php?product=$1&version=$2&tier=$3" [BCTLS,END]

#### Rewrites for /script folder: /model

RewriteRule "^model(/)?$" "/script/model-search/model-search.php" [END]
RewriteRule "^model/(.*)$" "/script/model/model.php?id=$1" [END]
RewriteRule "^model/(.*)$" "/script/model/model.php?id=$1" [BCTLS,END]

#### Rewrites for /script folder: /version

RewriteRule "^version(\/([^/]+)(\/([^/]+))?)?$" "/script/version/version.php?platform=$2&level=$4" [END]
RewriteRule "^version(\/([^/]+)(\/([^/]+))?)?$" "/script/version/version.php?platform=$2&level=$4" [BCTLS,END]
RewriteRule "^version(\/)?$" "/script/version/version.php" [END]

#### Rewrites for /script folder: /package-version
Expand Down
23 changes: 17 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM php:7.4-apache@sha256:c9d7e608f73832673479770d66aacc8100011ec751d1905ff63fae3fe2e0ca6d AS composer-builder
FROM php:8.4-apache@sha256:51da594c844a97f31b1cd6b1ac6660982f40788f4fe13e75f7fd39e2f9b58651 AS composer-builder

# Install Zip to use composer
RUN apt-get update && apt-get install -y \
Expand All @@ -18,7 +18,7 @@ COPY composer.* /composer/
RUN composer install

# Site
FROM php:7.4-apache@sha256:c9d7e608f73832673479770d66aacc8100011ec751d1905ff63fae3fe2e0ca6d
FROM php:8.4-apache@sha256:51da594c844a97f31b1cd6b1ac6660982f40788f4fe13e75f7fd39e2f9b58651
COPY resources/keyman-site.conf /etc/apache2/conf-available/
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
RUN echo memory_limit = 1024M >> /usr/local/etc/php/php.ini
Expand All @@ -29,16 +29,27 @@ RUN chown -R www-data:www-data /var/www/html/
# https://stackoverflow.com/a/72176870
RUN apt-get update && apt-get install -y gnupg2

# Adding custom MS repo
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
# Adding custom MS repo for Debian Trixie (13)
# https://learn.microsoft.com/en-us/linux/packages
# 'debian', '13' values from /etc/os-release
RUN curl -sSL -O https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb
RUN apt install ./packages-microsoft-prod.deb
RUN rm packages-microsoft-prod.deb
RUN apt-get update

## Install SQL Server drivers and Zip
RUN apt-get update && ACCEPT_EULA=Y apt-get -y --no-install-recommends install msodbcsql18 unixodbc-dev zip libzip-dev
RUN ACCEPT_EULA=Y apt-get -y --no-install-recommends install msodbcsql18 unixodbc-dev zip libzip-dev
RUN pecl install sqlsrv-5.10.1
RUN pecl install pdo_sqlsrv-5.10.1
RUN docker-php-ext-install pdo pdo_mysql zip
RUN docker-php-ext-enable sqlsrv pdo_sqlsrv pdo pdo_mysql

# Install intl extension

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intl was not bundled in the php-8.4 image, whereas it was in php-7.4; this also needs libicu-dev

RUN apt-get -y install libicu-dev
Comment thread
mcdurdin marked this conversation as resolved.
RUN docker-php-ext-install intl
RUN docker-php-ext-enable intl
Comment thread
mcdurdin marked this conversation as resolved.

# Copy all composer libraries in
COPY --from=composer-builder /composer/vendor /var/www/vendor

RUN a2enmod rewrite; a2enconf keyman-site
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ builder_describe \
"stop" \
"test" \
"info" \
"composer-start Start a temporary container to maintain composer" \
"composer-stop Stop and cleanup temporary container for maintaining composer" \
"--rebuild-test-fixtures Rebuild the test fixtures from live data" \
"--no-unit-test" \
"--no-lint" \
Expand Down Expand Up @@ -186,3 +188,5 @@ do_info() {

builder_run_action info do_info

builder_run_action composer-start docker_build_and_start_composer_container
builder_run_action composer-stop docker_stop_and_cleanup_composer_container
Comment on lines +191 to +192

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that these actions depend on an upcoming change to shared-sites. Putting them here for convenience only. They have no other impact.

6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"require": {
"sentry/sdk": "2.1.0",
"php-http/curl-client": "^2.1",
"swaggest/json-schema": "^0.12.29",
"guzzlehttp/guzzle": "^6.5",
"erusev/parsedown": "^1.7",
"erusev/parsedown-extra": "^0.8.1"
"sentry/sentry": "^4.31",
"guzzlehttp/guzzle": "^7.15"
},
"require-dev": {
"phpunit/phpunit": "^9"
Expand Down
Loading