Git Product home page Git Product logo

Comments (18)

ikajdan avatar ikajdan commented on May 28, 2024 2

It is more than one file, therefore I have created a repository: https://github.com/verahawk/davis-docker

To build it, run: docker build -t davis --build-arg='VERSION=2.0.2' .

You can find an example compose file in the example directory. Don't forget to run docker exec -it davis ash -c "APP_ENV=prod bin/console doctrine:schema:create --no-interaction", afterwards.

from davis.

tchapi avatar tchapi commented on May 28, 2024 2

I have started a first branch to use Alpine Linux instead of the regular distro, here: #77
I have already included the PostgreSQL PDO module in the image. I need to do some more testing, but the size gain is nice.

A second PR will look into how to make this work on the Symfony side. It might not come before two or three weeks as I'll be off.

Happy to have your thoughts on the Alpine version if ever you have some spare minutes :)

from davis.

tchapi avatar tchapi commented on May 28, 2024 1

Thanks @verahawk for this issue
I could easily add other drivers in the Dockerfile, that's easy.

As for Symfony, I can have a look. I think it can be a bit more difficult than just changing the driver in the Doctrine configuration..

As for Alpine, happy to view your Dockerfile so I can work from there.

TBH, I don't have much time to dig too deep though, so this may take a bit of time

from davis.

ikajdan avatar ikajdan commented on May 28, 2024 1

If you have any questions, feel free to ask. Although, it's been a while, so I might not remember why I have done things in a particular way ;)

from davis.

tchapi avatar tchapi commented on May 28, 2024 1

#79 has now been merged. I have released v3.1.0 (v3.0.0 has been yanked) with a new DATABASE_DRIVER env var (supporting MySQL and PostgreSQL for now)

LMK what you think. The release notes contain a lot of information (same as yanked version) since the schema has been partially migrated, and there is no straightforward path if you were using PostgreSQL before.

I'll try to test SQLite later, but don't hesitate to do it if you have the opportunity. If using it is possible, I'll need to add a bunch of SQLite-specific migrations since I'm now enforcing the platform + the migration path.

Closing for now as the original request (having a different driver for the Dockerized install) is now fulfilled πŸŽ‰

from davis.

King3R avatar King3R commented on May 28, 2024

Hey @verahawk,
is it possible that you share the image as long as tchapi has little time at the moment? That would be very nice.

from davis.

tchapi avatar tchapi commented on May 28, 2024

I can have a look at the Dockerfile and try to use alpine as a base but @verahawk has not provided it yet, I'd prefer not starting from scratch :)

from davis.

ikajdan avatar ikajdan commented on May 28, 2024

Oh, I completely forgot about this issue. Though, I still have project files. I will create a repo soon and post it here.

from davis.

tchapi avatar tchapi commented on May 28, 2024

You can just dump the Dockerfile in this issue, it's fine for me, no need to create a PR

from davis.

tchapi avatar tchapi commented on May 28, 2024

Ok thanks a lot! I will have a look and try to see what I can extract πŸ‘πŸΌ

from davis.

tchapi avatar tchapi commented on May 28, 2024

FYI after investigating a bit, PostgreSQL is not trivial: the VARBINARY format is not treated the same way by PDO/Doctrine on MySQL and Postgres, and leads to problems (because sabre/dav does not really support PostgreSQL), so I will probably need to:

  • alter some column definitions
  • make a new major version (because kind of BC)
  • add support for changing the driver

So a bit of work πŸ˜…

from davis.

ikajdan avatar ikajdan commented on May 28, 2024

Shame it is not so simple. Having an easy way to switch between mysql and sqlite will be good starting point anyway. Thanks for your work :-)

from davis.

King3R avatar King3R commented on May 28, 2024

Thanks also from my side.

Would it make sense to implement nginx as part of the change to Alpine? This way you would have an all-in-one solution in only one container, if you use SQLite. Or are there any opposing opinions on this?

from davis.

ikajdan avatar ikajdan commented on May 28, 2024

That's how it is done in the image, I have provided. I agree it would be nice to at least have two versions β€” one fpm and the other self-contained.

from davis.

tchapi avatar tchapi commented on May 28, 2024

I understand the need but it defeats the purpose of Docker in my opinion, because you'll end up with two processes in a single container, which is not ideal (and not the way Docker is supposed to work). You then have to add another supervisor process on top of both to allow for restarts / failure detection / health-check, etc ... and it's become a bit scrappy.

If I was to make an all-in-one container by the way, I would definitely not use nginx to be honest, but probably something more opinionated (maybe Caddy or Traefik for instance).

That being said, given the bandwidth I have at the moment, I'd rather focus on:

  • reducing the image size (in progress)
  • fixing the database columns (inherited from Baikal) that prevent the usage of Postgres (and possibly of other drivers)
  • allow Postgres and later SQLite as options to the Symfony stack

If a community effort arises with an "all-in-one" container, I'll be happy to link to it in the readme anyway :)

from davis.

sirrkitt avatar sirrkitt commented on May 28, 2024

If it helps or makes anyone happy, I can see if I can get it to play nicely with nginx unit. It’s kinda finicky with PHP applications though, because there’s a ton of weirdness.

I’m currently running Davis in a Podman container with H2O and php-cgi which also accomplishes running with a single executable.

from davis.

tchapi avatar tchapi commented on May 28, 2024

I have merged and pre-released v3.0.0 that fixes the database columns. If you don't use MySQL, I suggest to be very cautious since you will probably need to manually cast some column into VARCHAR (they were VARBINARY before)

I have tried to explain in length the upgrade process for the MySQL driver. I will let this sit for a while, and the next step will be to introduce a env var to select a specific driver. So far, I have tested the code with MySQL, MariaDB and PostgreSQL but not with SQLite.

from davis.

tchapi avatar tchapi commented on May 28, 2024

➑️ Work continues in #79

from davis.

Related Issues (20)

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.