wordpress docker setup
I’ve recently had the need to set up wordpress quickly for some testing while developing a new woocommerce extension and I’ve stupidly needed way more time than I hoped to have a working set up in docker so here’s the setup. docker-compose.yml services: wordpress: image: wordpress:latest container_name: wordpress ports: - "12999:80" # Only expose HTTP to the host environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_NAME: wordpress WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpresspass volumes: - ./wp-content:/var/www/html/wp-content/ networks: - wp-network depends_on: - db db: image: mysql:5.7 container_name: mysql environment: MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpresspass MYSQL_ROOT_PASSWORD: rootpass volumes: - db_data:/var/lib/mysql networks: - wp-network volumes: db_data: networks: wp-network: driver: bridge nginx reverse proxy configuration. Key part is that you need to set https headers for the proxy otherwise wordpress will serve the content back in mixed mode and your browser will complain ...