-
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
Resolve docker-compose issues in #69 #83
base: dev
Are you sure you want to change the base?
Conversation
…seed once, migrate only on demand
Docker-compose fixes
Make shaark target port static 80
Thank you @squ1rr3lly |
…in password when seeding. PDF archive test gets example.com instead of app->home. Removed puphpeteer and deps.
…me, fix crontab for Backups
Fix archiving/backup, update pdf library, clean up Dockerfile
All features including archiving and backups runs with docker-compose and the shaark Dockerfile would be more usable in other environments. I think this is production-ready, and would even be able to scale in a K8s/ECS/etc. deployment. I also made some code updates outside of just Docker, primarily switching the library used for PDF archiving to something that seemed better supported (spatie/browsershot). Main changes: Code:
Dockerfile:
docker-compose:
Entrypoint:
|
Hi, I've checked-in this branch and spent a couple of hours but can't make it work :-( SHAARK_PORT=8080 docker-compose up -d logs show:
|
Thank you @squ1rr3lly |
Hey @tborychowski, Have you rebuilt the images with a command such as |
Yes I did. And did it again just now. Same issue.
Maybe I just wait until the official image is out? :-) |
Ok I finally managed to fix my issue. |
Those WARNINGS are expected, the aborted db connection is the entrypoint making sure the DB is up before starting shaark. I just can't reproduce what you're seeing. I usually only saw a 500 when APP_URL wasn't right, but http://localhost is the default. Have you tried destroying the mariadb and redis volumes so they are rebuilt clean; a mismatch in that database volume is the first thing coming to mind? Anything in [edit] Awesome! Glad it's working for you. Was that something specific to your system or a change you had to make to the Docker/compose file? The Dockerfile is supposed to make everything in /app owned by shaarkuser. |
@squ1rr3lly, The only thing I had to change in docker-compose is the volumes entry for shaark service, to this:
Which is good for me as I actually prefer local folders (they make it easier for my backup scripts). edit: I've just tested it on Ubuntu 20.04 and it worked without any changes! Not sure why it wasn't on a mac :-| |
This pull request resolves #69 and brings the Dockerfile and docker-compose architecture into more modern versions and best-practices.
The main functional changes include:
SHAARK_PORT=8080 SHAARK_URL=shaark.awesome docker-compose up -d
will expose the service on port 8080 and set the APP_URL rather than using the defaults in the compse file.entrypoint-shaark.sh
to ensure database is only seeded once, and migrated only on demand when envSHAARK_MIGRATE_DB=true
wait-for-it.sh
script in the the shaark entrypoint to ensure mariadb is upsetEnv.sh
script allows linkingdocker-compose.override.yml
file to either 'dev' or 'production' mode. 'dev' mode exposes mariadb on 3306, enables debugging, and enables migrations.This does remove the nginx network and expose the shaark container directly. I think it's more straight-forward for development or running behind a load balancer etc., and someone who wanted to use a reverse-proxy could easily modify the compose file. Could also make revese-proxy another
setEnv.sh
mode.For the user who just wants it to go, cloning the repo and running
docker-compose up
will bring shaark up on port 80 with all the defaults.Known issues:
Enhancements:
setEnv.sh