# A docker-compose file to host a hiSHtory backend. To use: # 1. Update TODO_YOUR_POSTGRES_PASSWORD_HERE # 2. `docker compose -f backend/server/docker-compose.yml build` # 3. `docker compose -f backend/server/docker-compose.yml up` # 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 version: "3.8" 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 healthcheck: test: pg_isready -U postgres interval: 10s timeout: 3s hishtory: depends_on: postgres: condition: service_healthy networks: - hishtory build: context: ../../ dockerfile: ./backend/server/Dockerfile restart: unless-stopped deploy: restart_policy: condition: on-failure delay: 3s environment: HISHTORY_POSTGRES_DB: postgresql://postgres:TODO_YOUR_POSTGRES_PASSWORD_HERE@postgres:5432/hishtory?sslmode=disable ports: - 80:8080 volumes: postgres-data: