Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Docker compose For Wordpress
Mohammad Zakery
Mohammad Zakery

Posted on • Edited on

     

Docker compose For Wordpress

Wordpress

Wordpress Docker

How to use this image :

1.Clone or download all files fromGitHub Page
2.Download Wordpress fromWordpress Downloads
3.Extract Wordpress.zip to the following directory:

/var/www/html/wp
Enter fullscreen modeExit fullscreen mode

4.Run the command below :

docker-compose up -d
Enter fullscreen modeExit fullscreen mode

5.Open up your web browser, and proceed to the following address to start the installation ( Remember that my configuration will start the server at port 80, in case you want to change the hostname/port, proceed to the next section to customize this image )

127.0.0.1
Enter fullscreen modeExit fullscreen mode

6.If see 404 ERROR :

chmod 777 -R var/
Enter fullscreen modeExit fullscreen mode

7.In the Database settings, adjust the following :

Database Name = wordpressUsername = wpPassword = 147258369Database Host = mysqlTable Prefix = wp_
Enter fullscreen modeExit fullscreen mode

Customize this image :

Use domain with SSL and change Nginx configurations

in the files downloaded from thisGitHub Page
1.In this directory, uncomment the lines in thewp.conf and replace your domain withexample.com

/nginx/conf.d/wp.conf
Enter fullscreen modeExit fullscreen mode

2.Following the guides fromLetsencrypt (certbot), copy the privkey.pem and fullchain.pem to the following directory. (Remember that from the previous step, the cert files names should correspond with these config file) :

/nginx/conf.d/certs
Enter fullscreen modeExit fullscreen mode

3.In case you want to configure your Nginx, you can find the config file in the following directory :

/nginx/nginx.conf
Enter fullscreen modeExit fullscreen mode

Change mysql configurations :

1.Customize your configs in the following file :

/mysql/my.cnf
Enter fullscreen modeExit fullscreen mode

2.Change the mysql environment variables in the docker-compose.yml file :

environment:        MYSQL_ROOT_PASSWORD: 147258369        MYSQL_DATABASE: wordpress        MYSQL_USER: wp        MYSQL_PASSWORD: 147258369
Enter fullscreen modeExit fullscreen mode

Change php-fpm configurations :

Add your customized configurations in these files :

/php-fpm/php.ini-development/php-fpm/php.ini-production/php-fpm/www.conf/php-fpm/php.ini
Enter fullscreen modeExit fullscreen mode

Exposing external port :

Edit docker-compose.yml to change the exposed ports :

ports:     - 80:80     - 443:443
Enter fullscreen modeExit fullscreen mode

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Family 👨‍👩‍👧 DevOps 🐧 Boxing 🥊
  • Work
    Devops
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp