2022-11-05 07:41:56 +01:00
|
|
|
# A docker-compose file to host a hiSHtory backend. To use:
|
|
|
|
# 1. Update TODO_YOUR_POSTGRES_PASSWORD_HERE
|
2022-11-05 21:30:37 +01:00
|
|
|
# 2. `docker compose -f backend/server/docker-compose.yml build`
|
2022-11-05 21:46:08 +01:00
|
|
|
# 3. `docker compose -f backend/server/docker-compose.yml up`
|
2022-11-05 21:30:37 +01:00
|
|
|
# 4. Point your hiSHtory client at the server by putting `export HISHTORY_SERVER=http://1.2.3.4` in your shellrc
|
|
|
|
# 5. Run `hishtory init` to initialize hiSHtory with the local server
|
|
|
|
# 6. [Optional, but recommended] Add a TLS proxy to enable https
|
2023-09-05 20:52:46 +02:00
|
|
|
version: "3.8"
|
2022-11-05 07:41:56 +01:00
|
|
|
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:
|
2023-09-05 20:52:46 +02:00
|
|
|
- postgres-data:/var/lib/postgresql/data
|
|
|
|
healthcheck:
|
|
|
|
test: pg_isready -U postgres
|
|
|
|
interval: 10s
|
|
|
|
timeout: 3s
|
2022-11-05 07:41:56 +01:00
|
|
|
hishtory:
|
|
|
|
depends_on:
|
2023-09-05 20:52:46 +02:00
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
2022-11-05 07:41:56 +01:00
|
|
|
networks:
|
|
|
|
- hishtory
|
|
|
|
build:
|
2022-11-05 21:30:37 +01:00
|
|
|
context: ../../
|
2023-09-05 20:52:46 +02:00
|
|
|
dockerfile: ./backend/server/Dockerfile
|
2022-11-05 07:41:56 +01:00
|
|
|
restart: unless-stopped
|
2023-09-05 20:52:46 +02:00
|
|
|
deploy:
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
delay: 3s
|
2022-11-05 07:41:56 +01:00
|
|
|
environment:
|
2022-11-05 21:30:37 +01:00
|
|
|
HISHTORY_POSTGRES_DB: postgresql://postgres:TODO_YOUR_POSTGRES_PASSWORD_HERE@postgres:5432/hishtory?sslmode=disable
|
2022-11-05 07:41:56 +01:00
|
|
|
ports:
|
|
|
|
- 80:8080
|
2023-09-05 20:52:46 +02:00
|
|
|
volumes:
|
|
|
|
postgres-data:
|