Skip to content

Commit 0194f27

Browse files
authored
Base php 7.4 (#1812)
This is a PR to update the base-php image to 7.4. We will not update to future PHP versions, so it makes sense to just name this base-php We also add the mongodb-org-tools apt package to the base-php image for use in the backup/restore planned task.
1 parent 9479df3 commit 0194f27

File tree

6 files changed

+23
-18
lines changed

6 files changed

+23
-18
lines changed

.github/workflows/build-and-publish-base-php.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: docker/setup-buildx-action@v2
2121
with:
22-
platforms: linux/amd64,linux/arm64
22+
platforms: linux/amd64
2323

2424
- name: Log in to Docker Hub
2525
uses: docker/login-action@v2
@@ -28,4 +28,4 @@ jobs:
2828
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
2929

3030
- name: Build, tag and push image
31-
run: docker buildx build --push --platform linux/amd64,linux/arm64 -t ${{ env.IMAGE }} -f docker/base-php/Dockerfile .
31+
run: docker buildx build --push --platform linux/amd64 -t ${{ env.IMAGE }} -f docker/base-php/Dockerfile .

build.log

Whitespace-only changes.

docker/app/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,22 @@ RUN npm run build:${NPM_BUILD_SUFFIX}
3838
# COMPOSER-BUILDER
3939
# download composer app dependencies
4040
# git - needed for composer install
41-
FROM sillsdev/web-languageforge:base-php-7.4 AS composer-builder
41+
FROM sillsdev/web-languageforge:base-php AS composer-builder
4242
ENV COMPOSER_ALLOW_SUPERUSER=1
43-
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* \
44-
&& install-php-extensions @composer
4543
WORKDIR /composer
4644
COPY src/composer.json src/composer.lock /composer/
4745
RUN composer install
4846

4947
# PRODUCTION IMAGE
50-
FROM sillsdev/web-languageforge:base-php-7.4 AS production-app
51-
RUN rm /usr/local/bin/install-php-extensions
52-
RUN apt-get remove -y gnupg2
48+
FROM sillsdev/web-languageforge:base-php AS production-app
49+
RUN rm /usr/local/bin/install-php-extensions /usr/local/bin/composer
50+
RUN apt-get remove -y gnupg2 git
5351
RUN mv $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
5452
# had to add /wait into prod image so the prod image could be run through E2E tests.
5553
COPY --from=sillsdev/web-languageforge:wait-latest /wait /wait
5654

5755
# DEVELOPMENT IMAGE
58-
FROM sillsdev/web-languageforge:base-php-7.4 AS development-app
56+
FROM sillsdev/web-languageforge:base-php AS development-app
5957
RUN install-php-extensions xdebug-^3.1
6058
COPY docker/app/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d
6159
RUN mv $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini

docker/base-php/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
FROM php:7.3.28-apache
1+
# This image is based on debian 11 bullseye
2+
# https://hub.docker.com/layers/library/php/7.4-apache/images/sha256-c44681664d111addef2a2b6598901609990d45047b874c87d7d40fc7ce269195
3+
FROM php:7.4-apache
24

35
# install apt packages
6+
# gnupg - for installing Mongo GPG key below
7+
# git - for use by composer to install dependencies
48
# p7zip-full - used by LF application for unzipping lexicon uploads
59
# unzip - used by LF application for unzipping lexicon uploads
610
# curl - used by LF application
711
# ffmpeg - used by LF audio upload method
8-
RUN apt-get update && apt-get -y install p7zip-full unzip curl tini ffmpeg && rm -rf /var/lib/apt/lists/*
12+
RUN apt-get update && apt-get -y install gnupg git p7zip-full unzip curl tini ffmpeg
13+
14+
# Install MongoDB shell and tools (must be done after gnupg is installed)
15+
# mongodb-org-tools - contains mongoimport/mongoexport used by LF backup/restore project commands
16+
# mongodb-mongosh - contains mongosh which is useful for querying the db from the app container
17+
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor
18+
RUN echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list
19+
RUN apt-get update && apt-get -y install mongodb-org-tools mongodb-mongosh && rm -rf /var/lib/apt/lists/*
920

1021
# see https://github.com/mlocati/docker-php-extension-installer
1122
# PHP extensions required by the LF application
1223
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
13-
RUN install-php-extensions mongodb intl
24+
RUN install-php-extensions mongodb intl @composer
1425

1526
# php customizations
1627
COPY docker/base-php/customizations.php.ini $PHP_INI_DIR/conf.d/

docker/composer-dev/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ FROM sillsdev/web-languageforge:base-php
33

44
WORKDIR /work
55
ENV COMPOSER_ALLOW_SUPERUSER=1
6-
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* \
7-
&& install-php-extensions @composer
86
COPY src/composer.json src/composer.lock /work/
97

108
CMD ["bash"]

docker/test-php/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
FROM sillsdev/web-languageforge:base-php-7.4
1+
FROM sillsdev/web-languageforge:base-php
22

33

44
# ----- LINES BELOW COPIED FROM APP DOCKERFILE ----------
55
WORKDIR /var/www/html
66
ENV COMPOSER_ALLOW_SUPERUSER=1
7-
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* \
8-
&& install-php-extensions @composer
97
COPY src/composer.json src/composer.lock /var/www/html/
108
RUN composer install
119

12-
RUN install-php-extensions xdebug
10+
RUN install-php-extensions xdebug-^3.1
1311
COPY docker/app/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d
1412

1513
RUN mv $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini

0 commit comments

Comments
 (0)