Howto deploy wordpress using docker compose

This is how you can use docker compose to run WordPress on it

First make docker-compose.yml with this content


version: '2'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: ${MYSQL_DATABASE_PASSWORD}
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress_db
       MYSQL_PASSWORD: ${WORDPRESS_PASSWORD}

   wordpress:
     image: wordpress:latest
     ports:
       - 5500:80
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress_db
       WORDPRESS_DB_PASSWORD: ${WORDPRESS_PASSWORD}
     volumes: 
       - /home/ubuntu/wptest/wp-content:/var/www/html/wp-content
       - /home/ubuntu/wptest/php.ini:/usr/local/etc/php/conf.d/custom.ini

volumes:
    db_data:

and then make custom directory at your home to store your custom setting and then load it to your docker volume

for mine i put it on my /home/ubuntu/wp-test

make php.ini file on that custom directory and put this this code


upload_max_filesize = 20M
post_max_size = 20M

make .env file on that custom directory and put this this code


MYSQL_DATABASE_PASSWORD:mysql_password
WORDPRESS_PASSWORD:wordpress_password

Discover more from Susiloharjo

Subscribe to get the latest posts sent to your email.

Related Posts

flameshot

solving problem flameshot not run on ubuntu 24.04 lts

As you know Flameshot is a powerful, open-source screenshot tool for Linux and other platforms that offers advanced annotation and editing features directly within the capture interface….

ubuntu bluetooth

bluetooth problem with ubuntu 24.02 lts

I try many ways to fix my bluetooth speaker and finally this works for me , give a try maybe will help you also. restart the Bluetooth…

nginx-error-log

Howto resolve nginx proxy manager failed to renew ssl

  I’ve been using Nginx Proxy Manager for a couple of years now. It provides free SSL with Let’s Encrypt, is designed with security in mind, and…

neuralink brain chip

Neuralink: Revolutionizing Human-Computer Interaction with Brain-Computer Interfaces

What is Neuralink? Neuralink is a revolutionary technology developed by Elon Musk and his team of neuroscientists and engineers. The primary goal of Neuralink is to create…

LLM

Tech Giants Transform with LLMs: Elevating Services and User Experiences

Tech giants’ integration of large language models (LLMs) into various services is transforming the way businesses operate and interact with their customers. These advancements are not only…

vector storage

Advantages of Vector Storage for LLMs and AI

In the rapidly evolving landscape of artificial intelligence (AI) and machine learning (ML), one technology stands out as a game-changer: vector storage. This specialized form of data…

Discover more from Susiloharjo

Subscribe now to keep reading and get access to the full archive.

Continue reading