Added Postgres backend and SQLx.

This commit is contained in:
2026-09-19 22:13:38 +02:00
parent 04ebc95920
commit 15b8ae8f62
17 changed files with 1545 additions and 49 deletions
+30 -2
View File
@@ -4,15 +4,43 @@ services:
context: ./server
dockerfile: Dockerfile
init: true
depends_on:
postgres:
condition: service_healthy
environment:
RUST_LOG: info
RUST_LOG: trace
HOST: 0.0.0.0
PORT: 3000
DATABASE_URL: postgres://expenses:expenses@postgres:5432/expenses
SQLX_OFFLINE: "true"
ports:
- "3000:3000"
volumes:
- server-target:/app/target
- ./server:/app
networks:
- expenses_net
postgres:
image: postgres:17-alpine
environment:
POSTGRES_DB: expenses
POSTGRES_USER: expenses
POSTGRES_PASSWORD: expenses
healthcheck:
test: ["CMD-SHELL", "pg_isready -U expenses -d expenses"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- expenses_net
volumes:
server-target:
server-target:
postgres-data:
networks:
expenses_net:
name: expenses_net