Before you ask please READ THIS

Docker testing

edited August 2016 in FatMoon Posts: 18
Hi I am testing your theme in a Docker container. Have you tried using the theme with Docker?

I'm using the docker-compose example from the docker hub wordpress page.

Here's the docker-compose.yml file:-

wordpress:
  image: my-wordpress
  links:
    - db:mysql
  ports:
    - 18080:80

db:
  image: mariadb
  environment:
    MYSQL_ROOT_PASSWORD: example
And I've built the my-wordpress using a custom Dockerfile:-

FROM wordpress:4.5

COPY config/php.ini /usr/local/etc/php/

docker buid -t my-wordress
config/php.ini:-

memory_limit = "128M"
post_max_size = "32M"
upload_max_filesize = "128M"
max_execution_time = 200
All starts up fine and I can upload the theme through the admin -> them -> upload theme function.

The problem is that the plugins bundled in the advance/plugins directory (and referenced in the plugins-list.php) don't automatically load because WP is trying curl the localhost:18080 port from inside the container. It should be curling localhost:80.

The workaround is to extract them from the zip and upload manually via the admin -> plugins screen.

An example:
A13FATMOON_TPL_PLUGINS.'/revslider.zip'
which resolves to define('A13FATMOON_TPL_PLUGINS', A13FATMOON_TPL_ADV . '/plugins');
define('A13FATMOON_TPL_ADV', A13FATMOON_TPL_URI . '/advance');
and eventually define('A13FATMOON_TPL_URI', get_template_directory_uri());

How can I fix this so they load automatically please?

This is also a problem when updating the theme. I had to manually remove the redux-framework plugin (and I believe any settings that may have been overridden), before being able to upload the new bundled plugin after the recent update.

Any other recommendations for the Dockerfile in particular? I'm thinking wp-config.php in particular.

Thanks for any help here.
Post edited by Air on

Comments

  • AirAir
    Posts: 10,970
    Hello:-)

    I am first time hearing about Docker, so I will rather ask you about help with it :-)

    I think you should ask in Docker support about such things as they might have more experience about changing such things.

    Sorry for not being helpful.

    With kind regards.
  • Ok thanks for your response. May I ask how you develop locally? Do you use virtualbox for example?
  • AirAir
    Posts: 10,970
    We use MAMP or XAMPP depending on personal needs :-)

    Virtualbox we use for testing website on "foreign" browsers.

    With kind regards.
  • Lovely. I'll take a look. I suspect I might need a host entry and a way to configure the base url to not be localhost.

    So define('A13FATMOON_TPL_URI', get_template_directory_uri()); is returning localhost:18080 in my case, which is the external port mapping (which would be the same if running wp in a virtualbox vm).

    Is get_template_directory_uri() a wordpress function?

    Any links on how to set up a wordpress development environment would be appreciated. You're the experts :)
  • AirAir
    Posts: 10,970
    Hello again:-)
    paul_robinson_ said: Is get_template_directory_uri() a wordpress function?
    Yes this is WordPress function.

    About setting up WordPress I believe you should refer to many nicely made tutorials, as I don't know what exactly do you need. Wordpress Codex has many good articles about such things, like for this case https://codex.wordpress.org/Installing_WordPress

    Also more links http://lmgtfy.com/?q=setting+up+wordpress+development+environment ;-)

    Hope this will help you some.

    With kind regards.
  • Thanks again for your help here. I'm making progress with the dev environment. I'm going with the roots/bedrock vagrant box. I have an issue I am seeing after the verona theme download with a white home page, but wanted to get confirmation it's not environment related. I'll raise a separate ticket for that if I can reproduce it. Cheers!
  • Btw i noticed wp 4.6 is out. The docs say you support 4.5.x only. Do you see any issues with running 4.6? Thanks
  • AirAir
    Posts: 10,970
    paul_robinson_ said: Btw i noticed wp 4.6 is out. The docs say you support 4.5.x only.
    You mean compatibility table on ThemeForest? They are just so slow in adding option to check version 4.6 as also compatible - 4.6 is available for whole week already. Anyway FatMoon theme is working fine with WP 4.6.
    paul_robinson_ said: I have an issue I am seeing after the verona theme download with a white home page, but wanted to get confirmation it's not environment related. I'll raise a separate ticket for that if I can reproduce it
    Be sure to enable debug mode, to able to see what PHP error you got there https://codex.wordpress.org/Debugging_in_WordPress#WP_DEBUG
    It could also be JavaScript issue so check in console(F12 key in your browser)

    With kind regards.
  • AirAir
    Posts: 10,970
    paul_robinson_ said: I have an issue I am seeing after the verona theme download with a white home page, but wanted to get confirmation it's not environment related.
    I think I Know what is going on. Please disable plugin "WP Google Maps" or add there API key from google cause it causes JS error with out API key.

    With kind regards.

  • Thanks a mill. I did see a browser js error for the Google maps key, but assumed it wouldn't stop the verona revolution slide animation. I'll get a key. Ta
  • AirAir
    Posts: 10,970
    I have wrote to plugin authors, so hopefully they will fix plugin to not introduce JS error when API key is not given.

    With kind regards.
  • Thanks. For the benefit of others reading the forum, registering the Google Maps API key fixes the white screen problem.

    I have now confirmed this works both in the Docker and the roots Trellis/Bedrock base installation.

    I'll be moving forward with the roots Trellis/Bedrock base install since it gives me valuable features out of the box and allows me to move to a staging/production server with appropriate security, mail and configuration.

    Check it out.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!