Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Addon Developer Support Request] - Can volumes be used in the /conf/*.yml files? #30

Closed
frederickjh opened this issue Sep 24, 2018 · 7 comments

Comments

@frederickjh
Copy link
Contributor

Hi!
I submitted the adminer addon to this repo. I realized the other day that the default PHP 2M limit on uploads maximum size does not allow for many database files to be imported as they are too big.

I found that for the adminer docker image, this PHP limit can be increased by using a volume to place a file in the /usr/local/etc/php/conf.d/ directory. (increase → Unable to upload a file. Maximum allowed file size is 2MB.)

In the adminer/conf folder I created a uploads.ini and then used the following in adminer.yml file:

  # Adminer
  adminer:
    hostname: adminer
    image: adminer
    environment:
      - ADMINER_DEFAULT_SERVER=db # db is the default database container
      - ADMINER_PLUGINS=tables-filter tinymce # To load Adminer plugins
      - ADMINER_DESIGN=price # To use a bundled Adminer design
    labels:
      - io.docksal.virtual-host=adminer.${VIRTUAL_HOST}
    volumes:
      - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini

uploads.ini

upload_max_filesize = 500M
post_max_size = 500M
memory_limit = -1
max_execution_time = 0

When I go into the running terminal with sh and do ls /usr/local/etc/php/conf.d/ the file uploads.in is not listed and the new PHP settings in the file are not used. Running fin logs adminer does not show any errors.

So, is it possible to have volumes in the addons .yml files? Or am I missing something very obvious that I am doing incorrectly?

Thanks for your time and help!
Frederick

@frederickjh frederickjh changed the title [Addon Developer Support Request] - Can volumes be mounted in the /conf/*.yml files? [Addon Developer Support Request] - Can volumes be used in the /conf/*.yml files? Sep 24, 2018
@achekulaev
Copy link
Member

You can do anything you like in addons as far as it is not a malicious code and it works.

@frederickjh
Copy link
Contributor Author

Thanks @achekulaev
Any idea why the volume is not working? My directory structure looks like this:

image

adminer.yml contents are in my previous post.

I am assuming that the .yml files are docker-compose files as they follow the syntax but there is no version number at the top.

The docker-compose documentation says that paths relative to the compose file can be used in the host portion of a volume, so this should work, but it doesn't.

@frederickjh
Copy link
Contributor Author

@achekulaev Do you know what version of docker-compose these .yml files are for the addons if no version is given? And what versions are supported?

@achekulaev
Copy link
Member

I am not sure what you mean. These files are not being picked up automatically. In the adminer addon,, which was copied from the Mailhog, their content are being programmatically inserted into docksal.yml so they follow that version.

Also I'm not sure what "voume is not working" exactly means.

Lastly I don't think you should use ./ in volumes. It might have issues on the Windows platform. You should use environment variables to control those settings.

Which is another weird thing to me. You already use ENV variable in your yml above, so it means that your image is not just adminer, that one does not seem to have any environment vars support. You should probably use https://github.com/wodby/adminer and use env vars. Which should remove the whole question about volumes altogether.

@frederickjh
Copy link
Contributor Author

Actually I believe I copied the code from the PHPMyAdmin (pma) addon.

The wodby/adminer container looks like a better solution, as you pointed out it uses ENV variables to do the PHP configuration for Adminer. I will have to take a look at changing to this container. I just grabbed the oficial Adminer image when I set this up.

Also I'm not sure what "volume is not working" exactly means.

If you look at my OP you will see that means the volume is not being connected to the container as the files are not found inside the container.

@frederickjh
Copy link
Contributor Author

frederickjh commented Jan 23, 2019

Closing this even though I still do not know why the volume was not being mounted in the container. Switching to another image that allows setting these via ENV variables is a much better solution. I have create an new issue for this.

@achekulaev
Copy link
Member

@frederickjh it's hard to say for sure without looking and I don't have time to check, but I guess the path ./uploads.ini was not resolving, because working dir for docker-compose is .docksal folder. So I'd guess volume path should have been

addons/adminer/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants