Skip to content

Instantly share code, notes, and snippets.

@0xAliRaza
Last active August 19, 2024 05:56
Show Gist options
  • Save 0xAliRaza/3a24b71395c65cb8957ebe48ab21333e to your computer and use it in GitHub Desktop.
Save 0xAliRaza/3a24b71395c65cb8957ebe48ab21333e to your computer and use it in GitHub Desktop.
Local wordpress setup with Docker Compose
; log PHP errors to a file. E_ALL=32767
log_errors = on
error_reporting = 32767
error_log = /proc/1/fd/1
display_errors = On
display_startup_errors = On
error_reporting = E_ALL
services:
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- wordpress_db:/var/lib/mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=somewordpress
- MYSQL_DATABASE=wordpress
- MYSQL_USER=wordpress
- MYSQL_PASSWORD=wordpress
expose:
- 3306
- 33060
wordpress:
image: wordpress:latest
volumes:
- ./wp-data:/var/www/html
- ./logging.ini:/usr/local/etc/php/conf.d/logging.ini
- ./php.ini:/usr/local/php/php.ini
- ./php.ini:/usr/local/etc/php/php.ini
ports:
- 8080:80
restart: always
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=wordpress
- WORDPRESS_DB_NAME=wordpress
volumes:
wordpress_db:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment