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 image: ghcr.io/waveringana/simplelink:v2.2
23 container_name: shortener-app
24 ports:
25 - "8080:8080"
26 environment:
27 - DATABASE_URL=postgresql://shortener:shortener123@db:5432/shortener
28 - SERVER_HOST=0.0.0.0
29 - SERVER_PORT=8080
30 - JWT_SECRET=change-me-in-production
31 depends_on:
32 db:
33 condition: service_healthy
34 healthcheck:
35 test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
36 interval: 30s
37 timeout: 10s
38 retries: 3
39 start_period: 40s
40 networks:
41 - shortener-network
42 deploy:
43 restart_policy:
44 condition: on-failure
45 max_attempts: 3
46 window: 120s
47
48networks:
49 shortener-network:
50 driver: bridge
51
52volumes:
53 shortener-data: