-
Notifications
You must be signed in to change notification settings - Fork 6
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
(self-host|3): self-hostable platform! #982
Conversation
…r allow users to disable email
…nt:' vars using vars from 'env_file'
self-host/create-admin.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm bad at writing bash scripts. it would be nice if just had a cli for these things
platform-migrations: | ||
platform: linux/amd64 | ||
depends_on: | ||
db: | ||
condition: service_started | ||
image: ghcr.io/pubpub/platform-migrations:latest | ||
env_file: | ||
- path: .env | ||
required: true | ||
environment: | ||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} | ||
# FIXME: remove this once it's merged into main | ||
volumes: | ||
- ../core/prisma/create-admin-user.cts:/usr/src/app/core/prisma/create-admin-user.cts | ||
command: ["pnpm", "--filter", "core", "migrate-docker"] | ||
networks: | ||
- app-network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is used to, well, run the migrations when the app starts up. It's also used to generate the admin user.
I think we can probably get rid of this and put the important parts in platform
instead, but for now I'm not sure what the best way of doing this would be.
# FIXME: remove this once it's merged into main | ||
volumes: | ||
- ../core/prisma/create-admin-user.cts:/usr/src/app/core/prisma/create-admin-user.cts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed before merging, it's just here for testing.
reason: the core/prisma/create-admin-user.cts
does not exist yet on platform-migrations:latest
, because i just now added it 😅
once this pr is merged to main all will be swell
Some feedback from @eastofesten: apparently the |
also noting that step 4 for the caddy instructions didn't work (didn't say permission denied.) used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for running through the steps with me!
Issue(s) Resolved
Resolves #954
High-level Explanation of PR
Adds proper self-hosting support!
docker-compose.yml
inself-host
Test Plan
Basic
Try to follow the instruction in
self-host/README.md
and get the app running at least.Caddy config
Once you have the app up and running, try to get Caddy to serve the app and files over https locally.
All in
self-host
Uncomment all this
platform/self-host/docker-compose.yml
Lines 85 to 101 in 503022f
Configure local certificates
127.0.0.1 example.com
to your hosts (check whether it's not already there first)(or just edit it like a normal person)
Go to
https://example.com
in your browserClick away warnings blahblah
Should be greeted by PubPub!
Try to upload some files! They should be uploaded to
example.com/assets/<bucket>/<etc..>
Screenshots (if applicable)
Notes
Desired feedback
My main concerns are about how easy this is to follow for a slightly technical person. The documentation can and should be leagues better, but is it good enough that someone slightly familiar with a
docker-compose.yml
could figure it out?Also, what do you think of the default inclusion of
Caddy
? I think it's miles nicer thannginx
, and it would be nice to provide a built in solution for exposing your files on the same domain as your main one (annoying to have to set up multiple sometimes), but I did not really do a good job yet explaining how it works in the docs, and it does make things slightly more complex. On the other hand, you will need to set up SSL certificates anyway, so it's good we offer (albeit maybe slightly clunky) a way to do it.What is missing