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

Add ability to set database type #6

Closed
gil0109 opened this issue Nov 16, 2019 · 3 comments
Closed

Add ability to set database type #6

gil0109 opened this issue Nov 16, 2019 · 3 comments

Comments

@gil0109
Copy link

gil0109 commented Nov 16, 2019

I would like to use the docker image with other databases.

Any chance we could add a variable to adjust the driver parameter at the configuration.php file with the default being mysql?

Also, when I manually change the default, the mysqladmin ping -h"$FUSIO_DB_HOST" --silent in the docker-entrypoint.sh fails.

@chriskapp
Copy link
Member

Hi, so in general this would be possible but then you need to install also the fitting database driver and tools depending on the database which you want to use. Fusio is able to work with most databases. So which database do you want to use?

@gil0109
Copy link
Author

gil0109 commented Nov 17, 2019

Good point. I use openshift so I don't really worry about my database being down but it makes sense.

I am thinking we change the configuration.php and add a FUSIO_DB_TYPE variable:

    'psx_connection'          => [
        'dbname'              => getenv('FUSIO_DB_NAME'),
        'user'                => getenv('FUSIO_DB_USER'),
        'password'            => getenv('FUSIO_DB_PW'),
        'host'                => getenv('FUSIO_DB_HOST'),
        'driver'              => getenv('FUSIO_DB_TYPE'),

And maybe default it to mysql in the dockerfile environments (and others ?? .env/compose yaml)

And then just to do a if then on that environment variable in docker-entrypoint.sh to run the ping test in for just mysql until we figure out the ping test for all the other db options?

Other enhancements i am working on - maybe you want them as new issues. I am hoping you agree with them so I don't need to fork my changes independently.

  1. I have SQL Server driver support via the docker file, I am using openshift so i had to modify a bit to allow non-root running of odbc. I am hoping you could add that to your repo. Or if you want I could submit a pull request.
  2. I combined a lot of the dockerfile using && \ instead of separate RUN/ENV/etc.commands to reduce the size of the final dockerfile
  3. In Progress: Working on copying the output of /var/www/html/fusio/public (I think all I need is index.php) via the docker-entrypoint.sh as Openshift creates the volume outside of the build process so that folder is empty on initial startup.

Ref: https://github.com/gil0109/fusio-docker/tree/openshift_fixes

@chriskapp
Copy link
Member

We have added the type at the latest release

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