devfake/flox

Docker compose

dangerfish96 opened this issue ยท 13 comments

Hi,
very nice project.
Are there any plans to be able to use this with docker (-compose)?

Hey, thank you! :)

Unfortunately, I don't really have time for this right now. But i'm open for pull requests :)

The project looks amazing! However, I always wonder how people miss the opportunity to develop something inside Docker from the start to avoid polluting their local environments with dependencies. I might look into it but I'm in family first mode right now for the holidays ๐Ÿ˜ƒ

True, but i use something like devilbox or laradock for local development. Have good holidays ;)

exane commented

I always wonder how people miss the opportunity to develop something inside Docker from the start to avoid polluting their local environments with dependencies.

That's because Docker does not solve every problem that exists. While yes, in theory it is undoubtedly better to run everything isolated in its own VMs/Containers, but like many things it comes with its own trade-offs.

If you are not working on a Linux OS then chances are you are running sooner or later in annoying issues like performance slowdowns, file watching issues on mounted volumes or other annoyances like their pseudo tty container access while debugging.
And if you by chance were planning on deploying on an ARM architecture, but have been developing on a x86-64, you would have to go out of your way and start crosscompiling the image too. (Not anymore, I know) Also, in my case, that deployment env (rpi) did not have enough resources to run Docker properly, exclusively anyway. At this point the use case for Docker was rather slim back then in 2016/17, as we both (devfake and I) only deployed this via ssh on a vps and rpi.

Personally, I've been working with Docker and VMs like Bosh for a while now in a cloud-native environment in a cloud-hosting company and at this point I'm "fed-up" with development envs in containers or VMs that I would rather prefer to "pollute" my local machine than bother with these reoccuring annoyances.

I'm not saying Docker is not good or anything, just stating why some people might not wanna bother with Docker sometimes. So feel free to contribute. ๐Ÿ‘

So I forked the project (https://github.com/dangerfish96/flox) to add a docker-compose solution; Just because I want to learn how create the containers myself.
But I am stuck at the following error:

flox_1_80b801d0e6f0 | TRYING TO MIGRATE DATABASE
flox_1_80b801d0e6f0 | Nothing to migrate.
flox_1_80b801d0e6f0 | MIGRATION COMPLETED
flox_1_80b801d0e6f0 | 
flox_1_80b801d0e6f0 | In Connection.php line 669:
flox_1_80b801d0e6f0 |                                                                                
flox_1_80b801d0e6f0 |   SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'username' can  
flox_1_80b801d0e6f0 |   not be null (SQL: insert into `users` (`username`, `password`, `updated_at`  
flox_1_80b801d0e6f0 |   , `created_at`) values (?, $2y$10$ESzwusvOchjxSnuaiDa9tdWstzkRPbuVsI18ztK36  
flox_1_80b801d0e6f0 |   a9r7XxsUEBxi, 2019-12-23 12:43:34, 2019-12-23 12:43:34))                     
flox_1_80b801d0e6f0 |                                                                                
flox_1_80b801d0e6f0 | 
flox_1_80b801d0e6f0 | In PDOStatement.php line 123:
flox_1_80b801d0e6f0 |                                                                                
flox_1_80b801d0e6f0 |   SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'username' can  
flox_1_80b801d0e6f0 |   not be null                                                                  
flox_1_80b801d0e6f0 |                                                                                
flox_1_80b801d0e6f0 | 
flox_1_80b801d0e6f0 | In PDOStatement.php line 121:
flox_1_80b801d0e6f0 |                                                                                
flox_1_80b801d0e6f0 |   SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'username' can  
flox_1_80b801d0e6f0 |   not be null                                                                  
flox_1_80b801d0e6f0 |                                                                                
flox_1_80b801d0e6f0 | 

What could be the problem here? Is there maybe an interactive input that I am skipping to insert the username?

exane commented

There's a non-interactive way. ๐Ÿ˜„

https://github.com/devfake/flox/blob/master/backend/app/Console/Commands/DB.php#L14

There you can see that the command php artisan flox:db accepts default arguments for user and password. So if you'd use for example php artisan flox:db admin admin a user will be created with username "admin" and password "admin".

Could also be added to the readme for future use.

Thank you very much :)

You can have a look at https://git.walbeck.it/mwalbeck/docker-flox - data is stored in /var/www/flox/ and as far as I can tell you need a separate nginx container to invoke the php fpm that's in the flox container (?)

There's an explainer for that container in the issues here. You do need a separate nginx (or other webserver) container - the flox container is flox and php only.

I do have it working with the official nginx docker, but it all falls apart for me when I try to access it via a reverse proxy ๐Ÿ˜ข .

I am currently running Flox through a reverse proxy, the branch I am currently running is https://github.com/D3v01dZA/flox/tree/working and I did include some instructions and I also added my own feature to hide tv shows I have completed, feel free to remove that. Remember to run a db init!

Oh nice, I will take a look. Are you planning to publish containers to docker hub or ghcr?

Probably not, if I did I'd want to make the trusted proxies configurable and I'm not really planning on doing anything else for this right now

Sorry for the much too late reply. I will close this issue because i will completely redevelop Flox. In the next version, docker support will be included.