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

Docker image #1858

Closed
xsteadfastx opened this issue Apr 5, 2016 · 22 comments
Closed

Docker image #1858

xsteadfastx opened this issue Apr 5, 2016 · 22 comments
Labels

Comments

@xsteadfastx
Copy link

I use Docker containers for all my self hosting services and it would be great to have one for wallabag. i stepped into some problems with it. Mostly it was installation script related. The Script asks for a new admin user and that dialog breaks the build of the image because it doesnt support this interaction. what i did right now was, to provide a basic sqllite file that gets copied to the data/db directory if its not there already. and the container can start fresh. if the file is there it wont get copied and you have everything there like you left the container. i did this with a ansible entrypoint. with that we could easily add support for other databases too because the db init would get started on container starting and not on image creation. here is my first try:

https://github.com/xsteadfastx/dockerfiles/tree/master/wallabag

its not perfect at all. i see it as a first try.

@nicosomb nicosomb modified the milestone: 2.1.0 Apr 5, 2016
@binerf
Copy link

binerf commented Apr 6, 2016

Hi,

I was working on a wallabag container as well but now you made it... ;-)
Anyway, did you published it on hub.docker.com ?

Thanks

@nicosomb
Copy link
Member

nicosomb commented Apr 6, 2016

did you published it on hub.docker.com

Not yet.

I think we can create a wallabag/docker repository. @binerf @xsteadfastx are you interested to manage it?

@xsteadfastx
Copy link
Author

sure 👍 but we need a nice readme and a place to put it. what about a repo under the wallabag organization? today i wanted to work on mysql support for the container. there are still some open questions for me. what happens if you upgrade wallabag and the scheme changed? will it do some kind of ugprade page when you open it first?

@nicosomb
Copy link
Member

nicosomb commented Apr 6, 2016

what about a repo under the wallabag organization?

Sure. That's why I said "we can create a wallabag/docker repository" ;-)

About database changes, we'll have database migrations command.

@xsteadfastx
Copy link
Author

i think im in... but still alot to do. early alpha ;-) right now i got mysql support working. on container start it checks the environment variables what database you want to use and does database specific actions on container start... like add db and import a schema to it.

@xsteadfastx
Copy link
Author

recheck https://github.com/xsteadfastx/dockerfiles/tree/master/wallabag

added the mysql support.

@j0k3r
Copy link
Member

j0k3r commented Apr 6, 2016

I'm really not a fan of that: https://github.com/xsteadfastx/dockerfiles/blob/c5da4552a1a65063513910a914a93fd743d3c23b/wallabag/wallabag/root/etc/ansible/entrypoint.yml#L90

If we change something in the db structure, we'll have to maintain that too (same for the sqlite db).

I'm 👎 for that.

@xsteadfastx
Copy link
Author

so what to do differnet? maybe remove the "want to add a admin user" dialog in the installation script? or maybe a switch to disable that in the script.

@j0k3r
Copy link
Member

j0k3r commented Apr 6, 2016

Have you tried to call the wallabag:install with --no-interaction at the end? (I don't know how it'll behave)

@xsteadfastx
Copy link
Author

nope i didnt tried it. the best thing would be if there would be something like "--admin-user=", "--admin-password=".

@binerf
Copy link

binerf commented Apr 6, 2016

I initially added -n option with wallabag:install but I'm sure how to deal with admin-user afterwards.
Hopefully, with --no-interaction or -n option, default admin user is automatically created with "admin" password and you have to change it afterwards during the first login.

@j0k3r
Copy link
Member

j0k3r commented Apr 6, 2016

@binerf nope, it won't work like that.
My guess is that the admin user won't be created.

@binerf
Copy link

binerf commented Apr 6, 2016

So, a command is needed to create admin user after installation with options described by @xsteadfastx IF admin user and db are not already created (persistent data).

@DmitrySandalov
Copy link
Member

Hi guys, I vote for leaving Docker files inside the master repo (not in the separate wallabag/docker). In my commit I fixed the existing docker-compose script. After launching docker-compose up -d nginx and php-fpm are built. The run command in php-fpm installs composer, all deps and Wallabag itself. I tested the script with mysql, the user wallabag:wallabag is automatically created.

@xsteadfastx
Copy link
Author

i dont think that this is a good way to put this on docker hub. everything is splitted in different containers. if someone just want to test wallabag it can spin up one docker container and point the browser to it. everything included. right now you have to clone the code and mount it as volume. dont get me wrong... i think thats the perfect way for developing and testing the latest stuff. but for easy use, i think it would be the best if people just pull a image and start it.

how did you got around the "adding admin user" dialog? does this work with version 2.0.0? or did something change with the last commits?

@xsteadfastx
Copy link
Author

it looks like -n works perfectly. now i changed the ansible playbook to only run the installation command if a: there is now mysql db with the name wallabag after it created a db called wallabag, or b: if there is now wallabag.sqlite db file. i still wonder what would happen if there is a schema change. will the install command handle the migration?

i also only do a shallow clone in the Dockerfile of the wallabag repo to shrink the size a little. i maybe will write a readme and push it do dockerhub for easy testing.

@xsteadfastx
Copy link
Author

ok. here is my try: https://hub.docker.com/r/xsteadfastx/wallabag/

@binerf
Copy link

binerf commented Apr 8, 2016

@xsteadfastx: Thank you !!
I'll test it.

One question: what about process listening on port 8000 described in Wallabag documentation ? No need from outside container ?

@tcitworld
Copy link
Member

One question: what about process listening on port 8000 described in Wallabag documentation ? No need from outside container ?

This one is just for testing. In production you use wallabag with a real server (Apache, nginx,...).

@xsteadfastx
Copy link
Author

@binerf could you test it already? would love some feedback.

@nicosomb nicosomb modified the milestone: 2.1.0 Apr 12, 2016
@nicosomb
Copy link
Member

@binerf @xsteadfastx I created a new team and a new repo
https://github.com/wallabag/docker

You have permissions to commit on this repo.

@nicosomb
Copy link
Member

This issue was moved to wallabag/docker#1

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

No branches or pull requests

6 participants