Skip to content

Commit 8ecb976

Browse files
committed
Build bedrock images with php 8.1
1 parent 7dcd644 commit 8ecb976

26 files changed

+2605
-1
lines changed

.drone.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,61 @@ services:
152152
environment:
153153
DOCKER_TLS_CERTDIR: ""
154154

155+
---
156+
kind: pipeline
157+
name: wordpress-runtime-bedrock-php-8.1
158+
159+
depends_on:
160+
- php-runtime-8.1
161+
162+
workspace:
163+
base: /workspace
164+
path: src/github.com/bitpoke/stack-runtimes
165+
166+
steps:
167+
- &step
168+
name: setup docker
169+
pull: always
170+
image: docker.io/bitpoke/build:v0.8.0
171+
environment: &baseEnv
172+
TAG_SUFFIX: ${DRONE_BRANCH/master/}
173+
TEST_HOSTNAME: docker
174+
DOCKER_HOST: tcp://docker:2375
175+
commands:
176+
- dockerize -wait http://docker:2375/_ping -timeout 30s
177+
- docker info
178+
- make -C wordpress pull-$DRONE_STAGE_NAME
179+
180+
- <<: *step
181+
name: build image
182+
pull: default
183+
commands:
184+
- make -C wordpress $DRONE_STAGE_NAME
185+
186+
- <<: *step
187+
name: test image
188+
pull: default
189+
commands:
190+
- make -C wordpress test-$DRONE_STAGE_NAME
191+
192+
- <<: *step
193+
name: publish
194+
pull: default
195+
environment:
196+
<<: *baseEnv
197+
DOCKER_USERNAME: bitpokebot
198+
DOCKER_PASSWORD:
199+
from_secret: DOCKER_PASSWORD
200+
commands:
201+
- /usr/local/bin/setup-credentials-helper.sh
202+
- make -C wordpress push-$DRONE_STAGE_NAME
203+
204+
services:
205+
- name: docker
206+
image: docker:20.10.8-dind-rootless
207+
environment:
208+
DOCKER_TLS_CERTDIR: ""
209+
155210
---
156211
kind: pipeline
157212
name: wordpress-runtime-bedrock

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include common.Makefile
22

33
REGISTRY ?= docker.io/bitpoke
44
PHP_VERSION ?= 7.4.27
5-
WORDPRESS_VERSION ?= 5.8
5+
WORDPRESS_VERSION ?= 5.9
66

77
ifndef CI
88
TAG_SUFFIX ?= canary
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG BASE_IMAGE=docker.io/bitpoke/wordpress-runtime:bedrock-php-8.1
2+
FROM ${BASE_IMAGE} as bedrock
3+
WORKDIR /src
4+
# Install project dependencies as first build step for child images so that we
5+
# heat up composer cache
6+
ONBUILD COPY --chown=www-data:www-data composer.json composer.lock /src/
7+
ONBUILD RUN composer install --no-dev --no-interaction --no-progress --no-ansi --no-scripts
8+
9+
ONBUILD COPY --chown=www-data:www-data . /src
10+
ONBUILD RUN composer install --no-dev --no-interaction --no-progress --no-ansi --no-scripts
11+
ONBUILD RUN cp -a /src/. /app

wordpress/Dockerfile-bedrock-php-8.1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ARG PHP_BASE_IMAGE=docker.io/bitpoke/php-runtime:8.1
2+
FROM ${PHP_BASE_IMAGE} as bedrock
3+
4+
ENV WP_CLI_VERSION=2.2.0
5+
ENV WP_CLI_CONFIG_PATH=/app/wp-cli.yml
6+
ENV DOCUMENT_ROOT=/app/web
7+
ENV WP_CONTENT_DIR=${DOCUMENT_ROOT}/app
8+
ENV STACK_MEDIA_PATH=/app/uploads
9+
USER root
10+
COPY docker/build-scripts /usr/local/docker/build-scripts/
11+
RUN set -ex \
12+
&& /usr/local/docker/build-scripts/install-wp-cli \
13+
&& rm -rf /app \
14+
&& mkdir -p /app/web /src \
15+
&& { \
16+
echo "path: $DOCUMENT_ROOT/wp"; \
17+
} | tee /app/wp-cli.yml >&2 \
18+
&& chown -R www-data:www-data /app /src
19+
20+
COPY --chown=www-data:www-data ./docker /usr/local/docker
21+
USER www-data

wordpress/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,16 @@ push-wordpress-runtime-bedrock: push-wordpress-runtime-bedrock-build
3131

3232
wordpress-runtime-bedrock-php-8.0: wordpress-runtime-bedrock-build-php-8.0
3333
push-wordpress-runtime-bedrock-php-8.0: push-wordpress-runtime-bedrock-build-php-8.0
34+
35+
# Modify build targets for bedrock-php-8.1 so that we build, test and publish bedrock-php-8.1 and bedrock-build-php-8.1 variants
36+
.build/wordpress-runtime-bedrock-build-php-8.1: .build/wordpress-runtime-bedrock-php-8.1
37+
.build/wordpress-runtime-bedrock-build-php-8.1: BASE_IMAGE := local.build/wordpress-runtime-bedrock-php-8.1
38+
.build/wordpress-runtime-bedrock-build-php-8.1: DOCKER_BUILD := docker build
39+
40+
.build/tag-wordpress-runtime-bedrock-build-php-8.1: .build/tag-wordpress-runtime-bedrock-php-8.1
41+
42+
.build/test-wordpress-runtime-bedrock-build-php-8.1: .build/test-wordpress-runtime-bedrock-build-php-8.1 ;
43+
44+
wordpress-runtime-bedrock-php-8.1: wordpress-runtime-bedrock-build-php-8.1
45+
push-wordpress-runtime-bedrock-php-8.1: push-wordpress-runtime-bedrock-build-php-8.1
46+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
DB_NAME='database_name'
2+
DB_USER='database_user'
3+
DB_PASSWORD='database_password'
4+
5+
# Optionally, you can use a data source name (DSN)
6+
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
7+
# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'
8+
9+
# Optional database variables
10+
# DB_HOST='localhost'
11+
# DB_PREFIX='wp_'
12+
13+
WP_ENV='development'
14+
WP_HOME='http://example.com'
15+
WP_SITEURL="${WP_HOME}/wp"
16+
17+
# Specify optional debug.log path
18+
# WP_DEBUG_LOG='/path/to/debug.log'
19+
20+
# Generate your keys here: https://roots.io/salts.html
21+
AUTH_KEY='generateme'
22+
SECURE_AUTH_KEY='generateme'
23+
LOGGED_IN_KEY='generateme'
24+
NONCE_KEY='generateme'
25+
AUTH_SALT='generateme'
26+
SECURE_AUTH_SALT='generateme'
27+
LOGGED_IN_SALT='generateme'
28+
NONCE_SALT='generateme'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Application
2+
web/app/plugins/*
3+
!web/app/plugins/.gitkeep
4+
web/app/mu-plugins/*/
5+
web/app/upgrade
6+
web/app/uploads/*
7+
!web/app/uploads/.gitkeep
8+
web/app/cache/*
9+
10+
# WordPress
11+
web/wp
12+
web/.htaccess
13+
14+
# Logs
15+
*.log
16+
17+
# Dotenv
18+
.env
19+
.env.*
20+
!.env.example
21+
22+
# Composer
23+
/vendor
24+
25+
# WP-CLI
26+
wp-cli.local.yml

0 commit comments

Comments
 (0)