• A Docker image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. Available for both Linux and Windows based apps, containerized software will always run the same, regardless of the environment. Containers isolate software from its surroundings, for example differences between development and staging environments and help reduce conflicts between teams running different software on the same infrastructure.
  • A container is a runtime instance of an image—what the image becomes in memory when actually executed. It runs completely isolated from the host environment by default, only accessing host files and ports if configured to do so. Container are stateless and should be considered read only! (you can go inside the container change data, but at container creation your changes are lost)
  • Both MYSQL (Data, users) and Wordpress (plugins, themes, uploads) are stateful, so we have to use Docker volume to persist data across container restart.
  • expose: 3306 will let you connect later with MySQLWorbench to the port from outside of the container. it is optional.
  • depends_on tell wordpress to wait till mysql db container is up
  • The always restart policy tells Docker to restart the container under every circumstance. What’s great about the always restart policy is that even if our Docker host was to crash on boot, the Docker service will restart our container.
We will be using the official Wordpress image from Docker HUB But first let's create a file uploads.ini to avoid issues later on while uploading plugins in wordpress.

file_uploads = On
memory_limit = 256M
upload_max_filesize = 256M
post_max_size = 300M
max_execution_time = 600
Create a new file docker-compose.yml, adapt values to your liking, especially all passwords and username. Note that MYSQL and Worpress data are persisted OUTSIDE of container.

version: '2'

       - db
    image: wordpress:latest
     - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
     - ./file-wordpress:/var/www/html
      - 80:80
      - 443:443
    restart: always
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
    image: mysql:5.7
      - ./db-wordpress:/var/lib/mysql
    restart: always
      - "3306"
      MYSQL_ROOT_PASSWORD: wordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

The docker-compose up command aggregates the output of each container. It Builds, (re)creates, starts, and attaches to containers for a service. When the command exits, all containers are stopped. Running docker-compose up -d starts the containers in the background and leaves them running. To start Wordpress in the background

docker-compose up -d
To find the name of the container
docker ps -a
docker-compose ps
To read the logs file
docker logs wordpress
docker logs db
To go inside the container (remember all changes in there are lost at container restart)
docker exec -it wordpress bash
To delete all volume
docker-compose  rm -v
comments powered by Disqus

You might like also

Explore 142 Initial Exchange Offering  (IEO) by category, year and country
IEO is currently the most popular fundraising trend in the crypto industry. As the name suggests, Initial Exchange Offering is conducted over the crypto trading platform and exchanges. So unlike ICOs wherein crypto projects directly approach investors, IEOs involve a third-party in the form of crypto exchanges. An IEO is basically an ICO except that it is launched and managed by an existing exchange instead of the organization that created the token. The exchange holds and sells the token on …
26 Days ago
Security Token Offering (STO) statistics
Security token offering (STO) is a type of fundraising that is performed with a company offering tokenized securities. The defining feature of security token offerings is in its definition. Stocks, bonds and managed property trusts are another examples of securities. Essentially, a security token is a cryptocurrency-based asset that derives its value from some other asset that it represents. For example, security tokens can represent real estate or gold but, most importantly, they can represent shares and securities or their alternative. The tokens …
27 Days ago
systematization of knowledge within major blockchain protocols or consensus
Alexis Gauba presented a systematization of knowledge within major blockchain protocols or consensus, addresses the common challenges, economic model and solutions and provides a formal structure within which to compare them in this keynote presentation at Hyperledger Global Forum. …
105 Days ago
Stablecoins: Crypto's Holy Grail or Fools’ Errand? by Dr Garrick Hileman
I was attending the interesting LECTURE "Stablecoins: Crypto's Holy Grail or Fools’ Errand?" by Dr Garrick Hileman - Head of reseach at Blockchain - London School of Economics - United Kingdom at hashtagETH hashtagZurich and here is a copy of the slides Introducing: 2019 State of Stablecoins The 2019 report builds on its predecessor to provide an updated and expanded look at the current state of the stablecoin market - a space where we expect to see significant innovation in …
105 Days ago
The State of Stablecoins 2019: Hype vs. Reality in the Race for Stable, Global, Digital Money
The report, entitled “The State of Stablecoins 2019: Hype vs. Reality in the Race for Stable, Global, Digital Money” is based on information collected from 40 crypto and stablecoin firms. The report’s lead author is George Samman, a blockchain and cryptocurrency advisor. According to the document, Samman “was commissioned to research the stablecoin landscape and then independently report his findings for the broader industry to learn from.”      …
105 Days ago
The last 6 months of ICO have been imported and can be browse at I display there historical ICO data for all cryptocurrencies friendly countries for each month of the year. What you can get out of all these charts: You can see the number of ICO per months over 13 major countries (Cayman-Islands, UK, USA, Cyprus, Estonia, France, Germany, Liechtenstein, Malta, Russia, Singapore, Slovenia, Switzerland), Each country has its own color, how often that color appear on the map represents the …
105 Days ago
Consensus algorithms enable network participants to agree on the contents of a blockchain in a distributed and trust-less manner. I’ve listed in the past few months all of them at and thought it will be cool also to produce an Infographics The PNG (4528 x 2894 px, 2.5MB) can be downloaded here and the PDF version (280kb) with clickable consensus links here …
105 Days ago
No Thumbnail was found
Usually, a percentage of the tokens is sold to ICO participants and a percentage kept for the company’s needs. The token distribution and allocation of the token is usually a chapter in the future company whitepaper. A pie chart displays how and to whom tokens will be allocated. But how much tokens are allocated (amount) and what are they used for? how much token should I spend for advisor? is 15% of all tokens too much for founder? How many …
297 Days ago
No Thumbnail was found
introduction This is my attempt to list all possible blockchain consensus out there, I welcome pull request of the blockchain community! let's make it the main reference for blockchain consensus. Visit also to keep track of new developments in the distributed ledger technology space. Blockchain Consensus? At the core of the Blockchain disruption is a consensus algorithm: Consensus algorithms enable network participants to agree on the contents of a blockchain in a distributed and trust-less manner. “Consensus decision-making is a group …
308 Days ago
Initial Coin Offering security checklist
Blockchain technology and cryptocurrencies have revolutionized the way companies raise capital but at the same time are bringing their own sets of challenges. To ensure that your startup will go through that (ad)venture in a safe manner, you should always adhere to best security practices, for your company AND your investors.  This mind map will present you in a visual way lots of valuable information like: A compilation of the most dangerous threats to the ICO industry and how to mitigate, …
329 Days ago