Skip to content

Instantly share code, notes, and snippets.

@ogawa0071
Created May 3, 2022 06:55
Show Gist options
  • Select an option

  • Save ogawa0071/dfca97eb3eb06bc6836632a400968168 to your computer and use it in GitHub Desktop.

Select an option

Save ogawa0071/dfca97eb3eb06bc6836632a400968168 to your computer and use it in GitHub Desktop.
Docker Compose - WordPress with PlanetScale
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
WORDPRESS_CONFIG_EXTRA: define( 'MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL );
volumes:
- wordpress:/var/www/html
# db:
# image: mariadb
# restart: always
# environment:
# MYSQL_DATABASE: exampledb
# MYSQL_USER: exampleuser
# MYSQL_PASSWORD: examplepass
# MYSQL_RANDOM_ROOT_PASSWORD: "1"
# volumes:
# - db:/var/lib/mysql
volumes:
wordpress:
# db:
@abhagsain
Copy link

@ogawa0071 Can you share why does this work? Not working for me though

@ogawa0071
Copy link
Author

@abhagsain
This file is for PlanetScale Database. And of course you need to rewrite the environment.
A special setting for PlanetScale is WORDPRESS_CONFIG_EXTRA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment