Cannery should be configured for firearm and ammunition inventory policy controls with secure record handling. Proper configuration is essential for security and optimal operation.
# External URL for link generation and redirects
HOST=https://cannery.example.com
# Internal port (default: 4000)
PORT=4000
# Database connection string
DATABASE_URL=postgresql://cannery:password@localhost:5432/cannery
# Secret key for cookie signing (generate with: docker run -it shibaobun/cannery /app/priv/random.sh)
SECRET_KEY_BASE=replace-with-generated-key
# Registration settings (public, invite_only, disabled)
REGISTRATION=invite_only
# PostgreSQL connection settings
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=cannery
POSTGRES_PASSWORD=secure_password
POSTGRES_DB=cannery
# SMTP settings for notifications
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=user@example.com
SMTP_PASSWORD=secure_password
SMTP_FROM=noreply@example.com
SMTP_TLS=true
# Default language (en_US, de, fr, es)
LOCALE=en_US
# SSL settings (if running without reverse proxy)
SSL_CERT_PATH=/path/to/cert.pem
SSL_KEY_PATH=/path/to/key.pem
# Logging level (debug, info, warn, error)
LOG_LEVEL=info
# Upload limits (in bytes)
MAX_UPLOAD_SIZE=10485760 # 10MB
version: '3.8'
services:
cannery:
image: shibaobun/cannery:latest
restart: unless-stopped
ports:
- "4000:4000"
environment:
- HOST=https://cannery.yourdomain.com
- PORT=4000
- DATABASE_URL=postgresql://cannery:password@cannery-db:5432/cannery
- SECRET_KEY_BASE=your-generated-secret-key-here
- REGISTRATION=invite_only
- LOCALE=en_US
depends_on:
- cannery-db
cannery-db:
image: postgres:15-alpine
restart: unless-stopped
volumes:
- cannery_postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=cannery
- POSTGRES_USER=cannery
- POSTGRES_PASSWORD=secure_password
- POSTGRES_HOST_AUTH_METHOD=trust # For development only
volumes:
cannery_postgres_data:
Back up database, uploaded files/assets, and configuration/secrets metadata. Validate restore with one user login, one core business transaction, and one report/export check.
# Backup the PostgreSQL database
docker exec cannery-cannery-db-1 pg_dump -U cannery cannery > backup.sql
# Restore the PostgreSQL database
docker exec -i cannery-cannery-db-1 psql -U cannery cannery < backup.sql
Any questions?
Feel free to contact us. Find all contact information on our contact page.