Skip to content

Instantly share code, notes, and snippets.

@KEINOS
Last active October 7, 2023 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KEINOS/a821517a85992fe329489db2ce32bd56 to your computer and use it in GitHub Desktop.
Save KEINOS/a821517a85992fe329489db2ce32bd56 to your computer and use it in GitHub Desktop.
Docker-compose file for WordPress 5.5 + PHP 7.4.9, Apache 2.4.38 on the fly.
# docker-compose.yml for WordPress 5.5 + PHP 7.4.9, Apache 2.4.38
#
# - Download URL: https://git.io/JJ5Vu
# - How to run servers:
# $ php -r 'copy("https://git.io/JJ5Vu", "./docker-compose.yml");'
# $ docker-compose up -d
# - How to access:
# - Open browser: http://localhost:8989/
# - Ref: https://www.youtube.com/watch?v=pYhLEV-sRpY @ Youtube
version: '3'
services:
# Database
db:
image: mysql:8.0.21
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks:
- wpsite
# WordPress
wordpress:
depends_on:
- db
# WP 5.5.0, PHP 7.4.9, Apache 2.4.38
image: wordpress:5.5.0-php7.4-apache
ports:
- '8989:80'
restart: always
volumes: ['./wordpress:/var/www/html']
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
networks:
- wpsite
networks:
wpsite:
volumes:
db_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment