fix: eprintln for Docker logs, include migrations in stub build
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,19 +17,21 @@ async fn main() {
|
||||
.await
|
||||
.expect("Failed to connect to database");
|
||||
|
||||
eprintln!("colony: connected to {}", db_url);
|
||||
|
||||
// Enable WAL mode
|
||||
sqlx::query("PRAGMA journal_mode=WAL")
|
||||
.execute(&pool)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// Run migrations using sqlx's proper migration system
|
||||
// Run embedded migrations
|
||||
sqlx::migrate!("./migrations")
|
||||
.run(&pool)
|
||||
.await
|
||||
.expect("Failed to run migrations");
|
||||
|
||||
println!("Colony running on port {}", port);
|
||||
eprintln!("colony: migrations done, starting on port {}", port);
|
||||
|
||||
let app = Router::new()
|
||||
.route("/api/health", get(routes::health))
|
||||
|
||||
@@ -11,15 +11,16 @@ FROM rust:1.86-slim AS backend
|
||||
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /app
|
||||
|
||||
# Cache dependency build: copy manifests first, create stub sources, build deps
|
||||
# Cache dependency build: copy manifests + migrations, create stub sources
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY crates/colony-types/Cargo.toml crates/colony-types/Cargo.toml
|
||||
COPY crates/colony/Cargo.toml crates/colony/Cargo.toml
|
||||
COPY crates/colony/migrations crates/colony/migrations
|
||||
RUN mkdir -p crates/colony-types/src crates/colony/src \
|
||||
&& echo "fn main() {}" > crates/colony/src/main.rs \
|
||||
&& echo "" > crates/colony-types/src/lib.rs \
|
||||
&& cargo build --release -p colony 2>/dev/null || true \
|
||||
&& rm -rf crates/
|
||||
&& rm crates/colony/src/main.rs crates/colony-types/src/lib.rs
|
||||
|
||||
# Now copy real source and build (deps already cached)
|
||||
COPY crates/ crates/
|
||||
|
||||
Reference in New Issue
Block a user