Coder Social home page Coder Social logo

docker-wordpress-theme-setup's Introduction

docker-wordpress-theme-setup

This repository was created as part of a tutorial on how to setup a local development environment to build a WordPress theme.

Installation

If you don’t have Docker and Docker Compose installed follow the steps outlined in the blog post linked above.

With Docker installed and running, in Terminal:

git clone https://github.com/davidyeiser/docker-wordpress-theme-setup.git
cd docker-wordpress-theme-setup

Then:

docker-compose up -d

Then in your browser:

http://localhost:8000/

The aforementioned blog post has more information.

docker-wordpress-theme-setup's People

Contributors

davidyeiser avatar maybethisisru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-wordpress-theme-setup's Issues

Compose file invalid

Hi! When I start the file I get the following message

ERROR: The Compose file './docker-compose.yml' is invalid because: services.wordpress.environment.volumes contains ["./wp-content:/var/www/html/wp-content", "./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini"], which is an invalid type, it should be a string, number, or a null

Do you know what might be happening?

What if you need to add gulp to your theme development setup?

Great tutorial! I wish I had found this one earlier. I just spend the better part of my weekend setting up Docker with my Wordpress setup and sourced the internet for parts on how to set it up, yours seems so much more complete, so thanks! Now here is what my docker-compose.yml file looks like, I also added phpMyAdmin for good measure.

Now here is where I am stuck, my Wordpress theme development runs on Sage a theme developed by Roots.io and uses Gulp and Bower to compile static files. How would you add node, gulp and bower to your setup and run it from your theme folder inside the Docker container? I can easily run it from my host machine, but the best part of Docker is that you can run all your tools inside a confined container and run it with one command.

Sorry to bother you and if this isn't the right place to ask just close this issue and I'll be on my way.

[question] I got uploads.ini as a directory instead of a file

I am a newbie to Docker, and I find your blog a good tutorial.

I added this, ./uploads:ini:/usr/local/etc/php/conf.d/uploads.ini, to my docker-compose.yml. Then I get a directory named uploads.ini instead of a file named uploads.ini.

Please find the following screenshot of what I have got.
image

I am looking forward to hearing from you.
Cheers,

When running I get the following

Seems like an error in the network

db_1         | 2020-02-27 18:53:32+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.29-1debian9 started.
wordpress_1  | [27-Feb-2020 18:53:18 UTC] PHP Warning:  mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (2002) Connection refused
wordpress_1  | [27-Feb-2020 18:53:21 UTC] PHP Warning:  mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
wordpress_1  | [27-Feb-2020 18:53:21 UTC] PHP Warning:  mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
wordpress_1  | [27-Feb-2020 18:53:24 UTC] PHP Warning:  mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
wordpress_1  | [27-Feb-2020 18:53:24 UTC] PHP Warning:  mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
wordpress_1  | [27-Feb-2020 18:53:27 UTC] PHP Warning:  mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
wordpress_1  | [27-Feb-2020 18:53:27 UTC] PHP Warning:  mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
wordpress_1  | [27-Feb-2020 18:53:30 UTC] PHP Warning:  mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
wordpress_1  | [27-Feb-2020 18:53:30 UTC] PHP Warning:  mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
db_1         | 2020-02-27 18:53:32+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1         | 2020-02-27 18:53:32+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.29-1debian9 started.
db_1         | 2020-02-27T18:53:32.857256Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db_1         | 2020-02-27T18:53:32.858126Z 0 [Note] mysqld (mysqld 5.7.29) starting as process 1 ...
db_1         | 2020-02-27T18:53:32.860589Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1         | 2020-02-27T18:53:32.860599Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1         | 2020-02-27T18:53:32.860601Z 0 [Note] InnoDB: Uses event mutexes
db_1         | 2020-02-27T18:53:32.860603Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1         | 2020-02-27T18:53:32.860622Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1         | 2020-02-27T18:53:32.860624Z 0 [Note] InnoDB: Using Linux native AIO
db_1         | 2020-02-27T18:53:32.860859Z 0 [Note] InnoDB: Number of pools: 1
db_1         | 2020-02-27T18:53:32.860977Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1         | 2020-02-27T18:53:32.862006Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1         | 2020-02-27T18:53:32.868358Z 0 [Note] InnoDB: Completed initialization of buffer pool
db_1         | 2020-02-27T18:53:32.869835Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1         | 2020-02-27T18:53:32.882380Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1         | 2020-02-27T18:53:32.892844Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1         | 2020-02-27T18:53:32.892900Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1         | 2020-02-27T18:53:32.909159Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1         | 2020-02-27T18:53:32.909689Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1         | 2020-02-27T18:53:32.909696Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1         | 2020-02-27T18:53:32.909932Z 0 [Note] InnoDB: Waiting for purge to start
db_1         | 2020-02-27T18:53:32.960197Z 0 [Note] InnoDB: 5.7.29 started; log sequence number 13954659
db_1         | 2020-02-27T18:53:32.960394Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1         | 2020-02-27T18:53:32.960556Z 0 [Note] Plugin 'FEDERATED' is disabled.
db_1         | 2020-02-27T18:53:32.962294Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200227 18:53:32
db_1         | 2020-02-27T18:53:32.965373Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db_1         | 2020-02-27T18:53:32.965385Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
db_1         | 2020-02-27T18:53:32.966100Z 0 [Warning] CA certificate ca.pem is self signed.
db_1         | 2020-02-27T18:53:32.966129Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
db_1         | 2020-02-27T18:53:32.966483Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
db_1         | 2020-02-27T18:53:32.966511Z 0 [Note] IPv6 is available.
db_1         | 2020-02-27T18:53:32.966519Z 0 [Note]   - '::' resolves to '::';
db_1         | 2020-02-27T18:53:32.966529Z 0 [Note] Server socket created on IP: '::'.
db_1         | 2020-02-27T18:53:32.967489Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1         | 2020-02-27T18:53:32.975419Z 0 [Note] Event Scheduler: Loaded 0 events
db_1         | 2020-02-27T18:53:32.975646Z 0 [Note] mysqld: ready for connections.
db_1         | Version: '5.7.29'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
db_1         | 2020-02-27T18:53:33.739723Z 2 [Note] Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
wordpress_1  | [27-Feb-2020 18:53:33 UTC] PHP Warning:  mysqli::__construct(): (HY000/1045): Access denied for user 'wordpress'@'172.21.0.3' (using password: YES) in Standard input code on line 22
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (1045) Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
db_1         | 2020-02-27T18:53:36.742454Z 3 [Note] Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (1045) Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
db_1         | 2020-02-27T18:53:39.744843Z 4 [Note] Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (1045) Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
db_1         | 2020-02-27T18:53:42.747915Z 5 [Note] Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (1045) Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
db_1         | 2020-02-27T18:53:45.750870Z 6 [Note] Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
wordpress_1  | 
wordpress_1  | MySQL Connection Error: (1045) Access denied for user 'wordpress'@'172.21.0.3' (using password: YES)
wordpress_1  | 
wordpress_1  | WARNING: unable to establish a database connection to 'db:3306'
wordpress_1  |   continuing anyways (which might have unexpected results)
wordpress_1  | 
wordpress_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.3. Set the 'ServerName' directive globally to suppress this message
wordpress_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.3. Set the 'ServerName' directive globally to suppress this message
wordpress_1  | [Thu Feb 27 18:53:45.833182 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.3.5 configured -- resuming normal operations
wordpress_1  | [Thu Feb 27 18:53:45.833215 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND

Default themes

Good day

Is it possible to set up the docker-compose (or the Dockerfile) so the default themes would not be installed.

Thank you!!!

[Question] Upload to a repo

How should be handled in a repo? i mean after docker-compose is executed new files are created, should those files be added to .gitignore?

Thank you.

Multiple versions

Thanks for the tutorial. It made this so simple.

How can I create multiple containers, with separate DB's and ports for the different sites? Do you have a tutorial for that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.