mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-19 19:37:59 +02:00
Add docker-compose file for self hosting to fix #7
This commit is contained in:
parent
e7ec0a3ad2
commit
36f776053b
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
web/landing/www/binaries/hishtory-linux
|
web/landing/www/binaries/hishtory-linux
|
||||||
hishtory
|
hishtory
|
||||||
server
|
backend/server/server
|
||||||
|
@ -107,7 +107,7 @@ Download the latest binary from [Github Releases](https://github.com/ddworken/hi
|
|||||||
<summary>Self-Hosting</summary>
|
<summary>Self-Hosting</summary>
|
||||||
By default, hiSHtory relies on a backend for syncing. All data is end-to-end encrypted, so the backend can't view your history.
|
By default, hiSHtory relies on a backend for syncing. All data is end-to-end encrypted, so the backend can't view your history.
|
||||||
|
|
||||||
But if you'd like to self-host the hishtory backend, you can! The backend is a simple go binary in `backend/server/server.go` that uses postgres to store data. It reads the connection string for the postgres database from the environment variable `HISHTORY_POSTGRES_DB`.
|
But if you'd like to self-host the hishtory backend, you can! The backend is a simple go binary in `backend/server/server.go` that uses postgres to store data. It reads the connection string for the postgres database from the environment variable `HISHTORY_POSTGRES_DB`. If you don't yet have a postgres DB to use, you can use [`docker-compose.yml`](https://github.com/ddworken/hishtory/blob/master/backend/server/docker-compose.yml).
|
||||||
|
|
||||||
You can then point your local hishtory CLI to use this backend via the `HISHTORY_SERVER` environment variable (e.g. by doing `export HISHTORY_SERVER='https://hishtory.yourwebsite.example'` in your shellrc).
|
You can then point your local hishtory CLI to use this backend via the `HISHTORY_SERVER` environment variable (e.g. by doing `export HISHTORY_SERVER='https://hishtory.yourwebsite.example'` in your shellrc).
|
||||||
</details>
|
</details>
|
||||||
|
34
backend/server/docker-compose.yml
Normal file
34
backend/server/docker-compose.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# A docker-compose file to host a hiSHtory backend. To use:
|
||||||
|
# 1. Update TODO_YOUR_POSTGRES_PASSWORD_HERE
|
||||||
|
# 2. `docker compose up`
|
||||||
|
# 3. Point your hiSHtory client at the server by putting `export HISHTORY_SERVER=http://1.2.3.4` in your shellrc
|
||||||
|
# 4. [Optional, but recommended] Add a TLS proxy to enable https
|
||||||
|
networks:
|
||||||
|
hishtory:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- hishtory
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: TODO_YOUR_POSTGRES_PASSWORD_HERE
|
||||||
|
POSTGRES_DB: hishtory
|
||||||
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
|
volumes:
|
||||||
|
- ./postgres-data:/var/lib/postgresql/data
|
||||||
|
hishtory:
|
||||||
|
image: hishtory
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
networks:
|
||||||
|
- hishtory
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: ./backend/server/Dockerfile
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRESQL_PASSWORD: TODO_YOUR_POSTGRES_PASSWORD_HERE
|
||||||
|
ports:
|
||||||
|
- 80:8080
|
Loading…
x
Reference in New Issue
Block a user