-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Containerize Hush Line #346
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I stopped the container, started it again, and got "An internal server error occurred", though was working the first time running
|
… to be available, and add a redis container
glenn-sorrentino
approved these changes
May 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This containerizes Hush Line.
Follow the new
DEV.md
instructions to try it out: https://github.com/micahflee/hushline/blob/containerize/docs/DEV.mdThe dev instructions are now the same for all platforms since it's all just running in Docker. Ultimately, the container runs
python:3.12-bookworm
.Running
make dev
starts Hush Line in a container. You can see output from the container in that window, and press ctrl-c to quit. The rest of the Makefile commands (likemake test
, etc.) require the main container to be running to work, and they also do everything in the container.There's now a folder called
volumes
. After you start the server,volumes/app/hushline.db
will get created (this file isn't track in git). This way you can access the sqlite3 database outside of docker if you need to.Another big change is database migrations. There were two identical migrations which was causing it all to break, so I deleted one of them. And now, migrations run automatically when starting the server, so you don't have to make a separate migration step. You just add migrations and restart the server, and the db should be migrated.
Now that it's dockerized, actually running this in production needs to change a bit. The simplest way is to run in prod with docker-compose (on a cloud VM or a Raspberry Pi, or whatever), but it will require making a new
docker-compose.yaml
file withSECRET_KEY
andENCRYPTION_KEY
, and possibly other settings changed.@glenn-sorrentino please test this out and make sure you're able to get it working locally, and also continue development on top of it. It would be good to get this merged first before I continue other work -- like migrating from sqlite3 to postgres, which would be easier to host going forward.