036390a242
Replace manual schema.sql application with sqlx's built-in migration system. Migrations are embedded at compile time and tracked in the _sqlx_migrations table. Pending migrations run automatically on startup. - Move db/schema.sql → migrations/20260307000000_initial_schema.sql - Remove apply_schema() and split_sql_statements() from db.rs - Add run_migrations() using sqlx::migrate!() macro - Remove docker-compose schema.sql mount (app handles it now) - Enable sqlx "migrate" feature in Cargo.toml Future schema changes: add a new timestamped .sql in migrations/. Closes #190 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
818 B
YAML
Executable File
46 lines
818 B
YAML
Executable File
services:
|
|
postgres:
|
|
image: postgres:18.2-alpine3.23
|
|
restart: always
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: oxicloud
|
|
ports:
|
|
- "5432:5432"
|
|
networks:
|
|
- oxicloud
|
|
volumes:
|
|
- pg_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
oxicloud:
|
|
image: oxicloud
|
|
restart: always
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8086:8086"
|
|
networks:
|
|
- oxicloud
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- storage_data:/app/storage
|
|
|
|
networks:
|
|
oxicloud:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
pg_data:
|
|
storage_data:
|