Skip to content

Deploy Stowry with Docker

This guide covers deploying Stowry in production environments.

Terminal window
docker run -d \
--name stowry \
-p 5708:5708 \
-v $(pwd)/config.yaml:/config.yaml:ro \
-v $(pwd)/data:/data \
ghcr.io/sagarc03/stowry:latest serve
docker-compose.yml
version: '3.8'
services:
stowry:
image: ghcr.io/sagarc03/stowry:latest
container_name: stowry
restart: unless-stopped
ports:
- "5708:5708"
volumes:
- ./config.yaml:/config.yaml:ro
- stowry-data:/data
# serve never migrates a database on disk; --migrate asks it to.
command: serve --migrate
healthcheck:
# Only the alpine variant has a shell and wget; scratch, debian-slim
# and distroless do not, so check from outside the container instead.
disable: true
volumes:
stowry-data:
docker-compose.yml
version: '3.8'
services:
stowry:
image: ghcr.io/sagarc03/stowry:latest
container_name: stowry
restart: unless-stopped
ports:
- "5708:5708"
environment:
- STOWRY_DATABASE_TYPE=postgres
- STOWRY_DATABASE_DSN=postgres://stowry:password@postgres:5432/stowry?sslmode=disable
volumes:
- ./config.yaml:/config.yaml:ro
- stowry-data:/data
# serve never migrates a database it did not create; --migrate asks it to.
command: serve --migrate
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16-alpine
container_name: stowry-db
restart: unless-stopped
environment:
- POSTGRES_USER=stowry
- POSTGRES_PASSWORD=password
- POSTGRES_DB=stowry
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U stowry"]
interval: 5s
timeout: 5s
retries: 5
volumes:
stowry-data:
postgres-data: