-
Notifications
You must be signed in to change notification settings - Fork 59
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
Building with "docker-compose -d up" causes automatic abort. #69
Comments
Hi! Thank you for your feedback. Unfortunately I can't help you with docker (I never used Shaark with it). Maybe @Pandry can help you. |
Thanks for getting back to me! I'll wait for @Pandry's input. |
Hi. This most likely happens because php artisan migrate --seed needs user interaction:
While docker is building an image - no sql container is up so SQL exception seems to be expected. I tried moving php artisan migrate --seed -n --force and php artisan serve --host=0.0.0.0 --port=80 to sh script in entrypoint:
Migration was executed when all containers were up (though shaark container was up before db so had to restart shaark contained for migration to happen). This did the trick and migration completed, however the problem is that migration happened each time container is restarted - that is not good. I still think docker-entrypoint.sh should be used and migration should happen there, however there should be a way to do it once (maybe reading some value in DB or reading env variable?). PS. I still had problem with running shaark service and I found that app wasn't working due to missing gmp and/or bcmath php extension. I ended up with having this in Dockerfile as well:
Hope above will help. |
Thanks @johnatank, I'll try what you've suggested. |
Hi @johnatank Tried as you suggested (I think!), on my fork auladinglese/shaark (just so I could test the changes and keep them if they worked). Got this:
[RuntimeException] sh: git: not found install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] []... ERROR: Service 'shaark' failed to build: The command '/bin/sh -c apk add --no-cache --update openssl gmp gmp-dev zip unzip oniguruma-dev zlib-dev libpng-dev libzip-dev postgresql-dev && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && docker-php-ext-install gmp bcmath pdo mbstring gd exif zip sockets pdo_mysql pgsql pdo_pgsql && cp .env.example .env && sed -i s/DB_HOST=127.0.0.1/DB_HOST=mariadb/ .env && sed -i s/REDIS_HOST=127.0.0.1/REDIS_HOST=redis/ .env && sed -i s/APP_ENV=local/APP_ENV=production/ .env && sed -i s/APP_DEBUG=true/APP_DEBUG=false/ .env && sed -i s/CACHE_DRIVER=file/CACHE_DRIVER=redis/ .env && sed -i s/QUEUE_CONNECTION=sync/QUEUE_CONNECTION=redis/ .env && sed -i s/SESSION_DRIVER=file/SESSION_DRIVER=redis/ .env && sed -i s/REDIS_HOST=127.0.0.1/REDIS_HOST=redis/ .env && composer install --no-dev -o && php artisan optimize && php artisan view:clear && php artisan key:generate && php artisan storage:link && php artisan config:cache && ENTRYPOINT ["/app/run.sh"]' returned a non-zero code: 1` As you've likely guessed I'm not sure what I'm actually doing. Tried to follow your instructions but probably did something wrong. Wanted a dockerised version of Shaark because it means running my server is a little less challenging that way...in theory at least! |
Damn, sorry! |
Since I found out about Shaark with the demo, I fell in ❤️ Everything in my server is dockerized, it has been very very challenging to install Shaark that way. I encountered most of the same issues as described above. I already have Redis and MariaDB containers up and running (each of my services have their own Then I tweaked a few things, I skipped MariaDB for SQLite. The time, the image build succeeded and the page was up at the URL but I got a different error, Shaark could not access my Redis host and port. So I changed my I felt like I am turning around but somehow I missed this point was already mentioned here too. So I added the extra:
Now Shaark is up and running! Just it is frustrating not being able to use my existing MariaDB and Redis services, but for now my solution will do the trick. P.S. I talked too fast 😢 the new posts work but when I click on a link: |
Hi @frenchvandal, try adding to the |
@Pandry Regarding the extensions, is the PHP extension for Redis needed? I tried this in the RUN of my Dockerfile:
My build was successful. Is there a way I can check if Redis is actually working with Shaark? I dot see any data in its volume. |
@frenchvandal Redis is usefull when using queues for link archiving, see the install doc :) |
@MarceauKa oh I see, sorry I missed that :) With the current Dockerfile, I am not sure archiving could be executed since the dependencies mentioned in the doc are not installed? |
I like playing with Docker but I am not very familiar with the whole Shaark architecture. I found this post that should be a good starting point. I will make some tests on my server this week. |
Let me know what you think about #83. It should resolve all the issues discussed here, and add some nice usability features particularly for people that like to do development with docker-compose. I don't have much experience developing PHP and none with Laravel, but I think I kept things pretty clean. Thanks for maintaining this awesome tool! |
I messed with getting archives to work and after achieving a solid bruise from banging my head against the wall have decided it's just not feasible with alpine. I'm starting to play with builds using Laradock, but still learning the basics. Definitely agree it looks like a good fit, though. If anyone else has done some work there hit me up. |
@squ1rr3lly sorry, I'm confused... |
Hey @tborychowski , Yes, it works as written. You can just run I've been running and using this as my production instance for about a week and it's smooth and stable. |
I think I've finished up the changes on this. Details in #83, but backups and archives work correctly and the storage directory is a docker volume so all the settings will persist through a rebuild/redeploy of the containers. I also changed the library that's being used for PDF archiving from puphpeteer to browsershot. It seems better supported as puphpeteer is no longer maintained, and as far as I can tell has all the same functionality with less dependencies. If anyone has time to check that out and make sure everything works as expected, I'd appreciate it. I never actually got puphpeteer to work, but the archiving with browsershot seemed to do everything I'd want. |
Hi, first congratulations for this featurefull and very clean GUI bookmark manager. All 3 containers run ok, but when connecting, I get the Shaark background with: The console shows: full console output Any clue on this ? BTW do you plan to publish to docker hub ? Would be great to see it in "next version" |
@kriss6557 I have exactly the same error. Could not make it work :-( |
Hi all- I realize this thread is nearly 6 months old but I'm running into the same issues described above with what is currently posted. Any help to resolve would be great. screenshot |
Same issue.... |
I have the same problem like my previously colleagues (500 - Server Erorr). I just change .env file in working docker to work in local mode and turn on debug mode( I restarted docker after that changes. I got this error: |
Hi Marceau,
I really like your application, but am having some issues building it with docker-compose. I'm trying to build on a arch linux system following the instructions provided,
ERROR: Service 'shaark' failed to build: The command '/bin/sh -c apk add --no-cache --update openssl zip unzip oniguruma-dev zlib-dev libpng-dev libzip-dev postgresql-dev && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && docker-php-ext-install pdo mbstring gd exif zip sockets pdo_mysql pgsql pdo_pgsql && cp .env.example .env && sed -i s/DB_HOST=127.0.0.1/DB_HOST=mariadb/ .env && sed -i s/REDIS_HOST=127.0.0.1/REDIS_HOST=redis/ .env && sed -i s/APP_ENV=local/APP_ENV=production/ .env && sed -i s/APP_DEBUG=true/APP_DEBUG=false/ .env && sed -i s/CACHE_DRIVER=file/CACHE_DRIVER=redis/ .env && sed -i s/QUEUE_CONNECTION=sync/QUEUE_CONNECTION=redis/ .env && sed -i s/SESSION_DRIVER=file/SESSION_DRIVER=redis/ .env && sed -i s/REDIS_HOST=127.0.0.1/REDIS_HOST=redis/ .env && composer install -o && php artisan optimize && php artisan view:clear && php artisan key:generate && php artisan storage:link && php artisan config:cache && php artisan migrate --seed' returned a non-zero code: 1
It's very possible that the problem is me and not the docker-compose file! Any help or suggestions would be greatly appreciated.
Please let me know if there is any further information you would require.
Congratulations on a beautiful app (based on the hosted versions I've seen)
Best wishes
Matt
The text was updated successfully, but these errors were encountered: