Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docker image to a PHP8 version #98

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# key: ${{ runner.os }}-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-buildx-
- uses: docker/login-action@v1
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
Expand Down Expand Up @@ -60,6 +60,7 @@ jobs:
context: ./docker
file: ./docker/Dockerfile
tags: ${{ steps.prep.outputs.tags }}
platforms: linux/amd64,linux/arm64
build-args: |
WPSNAPSHOTS_ARCHIVE=${{ steps.prep.outputs.archive }}
labels: |
Expand Down
34 changes: 25 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
FROM 10up/phpfpm
FROM 10up/wp-php-fpm-dev:8.0-ubuntu AS builder

ARG WPSNAPSHOTS_ARCHIVE
ENV WPSNAPSHOTS_ARCHIVE $WPSNAPSHOTS_ARCHIVE

USER root

WORKDIR /opt/wpsnapshots

RUN useradd wpsnapshots && \
mkdir -p /home/wpsnapshots && \
chown -R wpsnapshots:wpsnapshots /home/wpsnapshots && \
wget -q -c ${WPSNAPSHOTS_ARCHIVE} -O - | tar -xz --strip 1 && \
composer install --no-dev --no-progress && \
composer clear-cache && \
chown -R wpsnapshots:wpsnapshots /opt/wpsnapshots
RUN \
useradd wpsnapshots && \
mkdir -p /home/wpsnapshots && \
chown -R wpsnapshots:wpsnapshots /home/wpsnapshots && \
wget -q -c ${WPSNAPSHOTS_ARCHIVE} -O - | tar -xz --strip 1 && \
composer install --no-dev --no-progress && \
composer clear-cache && \
chown -R wpsnapshots:wpsnapshots /opt/wpsnapshots

FROM 10up/base-php:7.4-ubuntu

USER root

WORKDIR /opt/wpsnapshots

COPY --from=builder --chown=wpsnapshots=wpsnapshots /opt/wpsnapshots /opt/wpsnapshots
RUN \
apt-get update && apt-get install mariadb-client -y && apt-get clean all && \
useradd wpsnapshots && \
mkdir -p /home/wpsnapshots && \
chown -R wpsnapshots:wpsnapshots /home/wpsnapshots && \
chown -R wpsnapshots:wpsnapshots /opt/wpsnapshots
COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]
ENTRYPOINT [ "/entrypoint.sh" ]