Skip to content

Commit

Permalink
Update to PHP8 image
Browse files Browse the repository at this point in the history
Builds upon #92
  • Loading branch information
darylldoyle committed Jun 13, 2023
1 parent cf28870 commit 1facfe7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
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" ]

0 comments on commit 1facfe7

Please sign in to comment.