A very performant and light (2mb in memory) link shortener and tracker. Written in Rust and React and uses Postgres/SQLite.
1services: 2 db: 3 image: postgres:15-alpine 4 container_name: shortener-db 5 environment: 6 POSTGRES_DB: shortener 7 POSTGRES_USER: shortener 8 POSTGRES_PASSWORD: shortener123 9 ports: 10 - "5432:5432" 11 volumes: 12 - shortener-data:/var/lib/postgresql/data 13 healthcheck: 14 test: ["CMD-SHELL", "pg_isready -U shortener"] 15 interval: 5s 16 timeout: 5s 17 retries: 5 18 networks: 19 - shortener-network 20 21 app: 22 build: 23 context: . 24 dockerfile: Dockerfile 25 args: 26 - API_URL=${API_URL:-http://localhost:3000} 27 container_name: shortener-app 28 ports: 29 - "8080:8080" 30 environment: 31 - DATABASE_URL=postgresql://shortener:shortener123@db:5432/shortener 32 - SERVER_HOST=0.0.0.0 33 - SERVER_PORT=8080 34 - JWT_SECRET=change-me-in-production 35 depends_on: 36 db: 37 condition: service_healthy 38 healthcheck: 39 test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"] 40 interval: 30s 41 timeout: 10s 42 retries: 3 43 start_period: 40s 44 networks: 45 - shortener-network 46 deploy: 47 restart_policy: 48 condition: on-failure 49 max_attempts: 3 50 window: 120s 51 52networks: 53 shortener-network: 54 driver: bridge 55 56volumes: 57 shortener-data: