Overview
Sciety is deployed as a containerized application using Docker. The platform supports multiple deployment targets:- Local development with Docker Compose
- Production on Kubernetes using Helm charts
- Staging environments for testing
Prerequisites
Docker
Docker Engine 20.10 or higher
Docker Compose
Docker Compose v2.0 or higher
Node.js
Node.js 24 (Alpine-based in production)
GNU Make
For running build commands
Additional Requirements for Production
- Kubernetes cluster (v1.20+)
- kubectl configured for cluster access
- Helm 3 for chart deployment
- AWS CLI (for S3 event exports)
- Git LFS (for handling large files)
Docker Setup
Multi-Stage Build
Sciety uses a multi-stage Dockerfile with optimized build targets:Development Environment
The Features:
dev stage includes all development dependencies and hot-reload capabilities:- TypeScript compilation
- ESLint and Stylelint
- Jest testing framework
- Development server with auto-restart
Production Build
The Optimizations:
prod stage creates an optimized production image:- Production-only dependencies
- Compiled TypeScript to JavaScript
- Minified CSS
- Health check endpoint at
/ping
Docker Compose Deployment
Quick Start
http://localhost:8080.
Service Architecture
The docker-compose.yml defines three core services:docker-compose.yml
Service Details
Service Details
App Service
App Service
- Image: Built from local Dockerfile
- Port: 8080 (configurable via
APP_PORT) - Health Check: HTTP GET
/pingevery 5 seconds - Dependencies: PostgreSQL and Redis must be running
Database Service
Database Service
- Image: PostgreSQL 14.19 Alpine
- Default Credentials: user=
user, password=secret, database=sciety - Data Volumes: Mounted CSV files for test data
- Health Check:
pg_isreadycommand
Cache Service
Cache Service
- Image: Redis (latest)
- Purpose: Application-level caching for improved performance
- Access: Available to app via hostname
cache
Container Management
Health Checks
Sciety includes built-in health monitoring:Application Health
Application Health
- Endpoint:
http://localhost:80/ping - Interval: 5 seconds
- Timeout: 1 second
- Command:
wget --quiet --tries=1 --spider
Database Health
Database Health
Cache Health
Cache Health
Initial Data Population
Troubleshooting
Port Already in Use
Port Already in Use
Change the port in your Then restart:
.env file:Container Won't Start
Container Won't Start
Check logs for errors:Common issues:
- Missing environment variables (check
.envfile) - Port conflicts
- Database connection failures
Database Connection Failed
Database Connection Failed
Ensure database is running and healthy:Verify credentials in docker-compose.yml match your configuration.
Changes Not Reflecting
Changes Not Reflecting
For most code changes, containers auto-restart. If not:Rebuild required for:
- Changes to
package.json - Dockerfile modifications
- Native dependency updates
Node.js Configuration
Sciety uses Node.js with specific runtime options:Dockerfile
Strict Rejections
Unhandled promise rejections terminate the process, ensuring errors are caught early
Source Maps
Enabled for better debugging of compiled TypeScript code
Environment-Specific Settings
Package Management
Sciety uses pnpm for faster, more efficient dependency management:The
--frozen-lockfile flag ensures consistent installations by preventing lockfile updates during build.Next Steps
Configuration
Learn about environment variables and external service credentials
Kubernetes
Deploy to production using Helm charts