Sign inSign up

imoize/wordpress

By imoize

•Updated almost 2 years ago

Minimal, Docker images for Wordpress

Image
1

1.6K

imoize/wordpress repository overview

⁠Wordpress Docker Image

Minimal, Docker images for Wordpress. This image not include with web server and need seperate web server container.

Github Build Status GitHub GitHub Package Repository Docker Pulls

⁠Supported Architectures

Multi-platform available trough docker manifest. Simply pulling using latest tag should retrieve the correct image for your arch.

The architectures supported by this image:

ArchitectureAvailable
x86-64✅
arm64✅

⁠Usage

Here are some example to help you get started creating a container, easiest way to setup is using docker-compose or use docker cli.

  • docker-compose (recommended)
---
version: "3.9"
services:
  wordpress:
    image: imoize/wordpress:latest
    container_name: wordpress
    ports:
      - 9000:9000
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=Asia/Jakarta
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_NAME=wordpress
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=wordpress
    volumes:
      - /path/to/app/data:/config
    restart: always
  • docker cli
docker run -d \
  --name=wordpress \
  -p 9000:9000
  -e PUID=1001 \
  -e PGID=1001 \
  -e TZ=Asia/Jakarta \
  -e WORDPRESS_DB_HOST=db \
  -e WORDPRESS_DB_NAME=wordpress \
  -e WORDPRESS_DB_USER=wordpress \
  -e WORDPRESS_DB_PASSWORD=wordpress \
  -v /path/to/app/data:/config \
  --restart always \
  imoize/wordpress:latest

⁠Available environment variables:

NameDescriptionDefault Value
PUIDUser UID
PGIDGroup GID
TZSpecify a timezone see this list⁠.UTC
S6_VERBOSITYControls the verbosity of s6-rc. See this.⁠1
BYPASS_DB_CHECKBypass Database check before service start.no
WORDPRESS_DB_HOSTDefine database hostname. Can use docker secret.
WORDPRESS_DB_NAMEDefine database name. Can use docker secret.
WORDPRESS_DB_USERDefine database user. Can use docker secret.
WORDPRESS_DB_PASSWORDDefine database password. Can use docker secret.
WORDPRESS_TABLE_PREFIXDefine table prefix, you can change it. Can use docker secret.wpx_
MEMORY_LIMITSet PHP Memory Limit.256M
MAX_INPUT_TIMESet PHP Maximum Input Time.600
MAX_INPUT_VARSSet PHP Maximum Input Vars.5000
MAX_FILE_UPLOADSSet PHP Maximum File can be Upload.20
MAX_EXECUTION_TIMESet PHP Maximum Execution Time.600
POST_MAX_SIZESet PHP Maximum Post Size.16M
UPLOAD_MAX_FILESIZESet PHP Maximum Filesize can be Upload.16M
OPCACHE_ENABLESet PHP Opcache enable or not.true

⁠Configuration

⁠Environment variables

When you start the wordpress image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker-compose file or on the docker run command line. Please note that some variables are only considered when the container is started for the first time. If you want to add a new environment variable:

  • for docker-compose add the variable name and value:
wordpress:
    ...
    environment:
      - PUID=1001
      - TZ=Asia/Jakarta
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_NAME=wordpress
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=wordpress
      - BYPASS_DB_CHECK=yes
    ...
  • for manual execution add a -e option with each variable and value:
  docker run -d \
  -e PUID=1001 \
  -e TZ=Asia/Jakarta \
  -e WORDPRESS_DB_HOST=db \
  -e WORDPRESS_DB_NAME=wordpress \
  -e WORDPRESS_DB_USER=wordpress \
  -e WORDPRESS_DB_PASSWORD=wordpress \
  -e BYPASS_DB_CHECK=yes \
  imoize/wordpress:latest
⁠Docker Secrets Support

You can append _FILE (double underscore) to WORDPRESS_DB* env.

services:
  wordpress:
      ...
      environment:
        - PUID=1001
        - WORDPRESS_DB_PASSWORD__FILE="/run/secrets/wordpress_password"
      secrets:
        - wordpress_password

secrets:
  wordpress_password:
    external: true
      ...

⁠Volume

⁠Persisting your application

If you remove the container all your data will be lost, and the next time you run the image the data and config will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.

For persistence you should map directory inside container in /config path to host directory as data volumes. Application state will persist as long as directory on the host are not removed.

e.g: /path/to/app/data:/config

wordpress:
    ...
    environment:
      - PUID=1001
    volumes:
      - /path/to/app/data:/config
    ...

/config folder contains wordpress relevant configuration files.

⁠User / Group Identifiers

For example: PUID=1001 and PGID=1001, to find yours user id and gid type id <your_username> in terminal.

  $ id your_username
    uid=1001(user) gid=1001(group) groups=1001(group)

⁠Contributing

We'd love for you to contribute to this container. You can submitting a pull request⁠ with your contribution.

⁠Issues

If you encountered a problem running this container, you can create an issue⁠.

Tag summary

Content type

Image

Digest

sha256:a414bd269…

Size

100.3 MB

Last updated

almost 2 years ago

docker pull imoize/wordpress