chore: add verbose logging and switch to glibc build for synology compatibility
This commit is contained in:
parent
b6e1e0a647
commit
25d93052d4
2 changed files with 26 additions and 6 deletions
15
Dockerfile
15
Dockerfile
|
|
@ -11,31 +11,36 @@ WORKDIR /app/backend
|
|||
RUN apt-get update && apt-get install -y \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
musl-tools \
|
||||
curl \
|
||||
libc6-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN rustup target add x86_64-unknown-linux-musl
|
||||
COPY backend-rust/Cargo.toml backend-rust/Cargo.lock ./
|
||||
RUN cargo fetch
|
||||
COPY backend-rust/ ./
|
||||
RUN cargo build --release --target x86_64-unknown-linux-musl --bin backend-rust
|
||||
RUN cargo build --release --bin backend-rust
|
||||
|
||||
FROM python:3.11-slim-bookworm
|
||||
WORKDIR /app
|
||||
|
||||
# Install runtime dependencies including Node.js for yt-dlp
|
||||
RUN apt-get update && apt-get install -y \
|
||||
ffmpeg \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg \
|
||||
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install --no-cache-dir -U "yt-dlp[default]"
|
||||
|
||||
COPY --from=backend-builder /app/backend/target/x86_64-unknown-linux-musl/release/backend-rust /app/server
|
||||
COPY --from=backend-builder /app/backend/target/release/backend-rust /app/server
|
||||
COPY --from=frontend-builder /app/frontend/dist /app/static
|
||||
|
||||
RUN mkdir -p /tmp/spotify-clone-cache /tmp/spotify-clone-downloads && chmod 777 /tmp/spotify-clone-cache /tmp/spotify-clone-downloads
|
||||
|
||||
ENV PORT=8080
|
||||
ENV RUST_LOG=info
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
EXPOSE 8080
|
||||
|
||||
RUN chmod +x /app/server
|
||||
|
|
|
|||
|
|
@ -12,12 +12,16 @@ use tower_http::{
|
|||
cors::{Any, CorsLayer},
|
||||
services::ServeDir,
|
||||
};
|
||||
use std::io::Write;
|
||||
|
||||
use crate::api::AppState;
|
||||
use crate::spotdl::SpotdlService;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
println!("SERVER STARTING UP...");
|
||||
std::io::stdout().flush().unwrap();
|
||||
|
||||
let spotdl = SpotdlService::new();
|
||||
spotdl.start_background_preload();
|
||||
|
||||
|
|
@ -41,6 +45,17 @@ async fn main() {
|
|||
let addr = SocketAddr::from(([0, 0, 0, 0], 8080));
|
||||
println!("Backend running on http://{}", addr);
|
||||
|
||||
let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
|
||||
let listener = match tokio::net::TcpListener::bind(&addr).await {
|
||||
Ok(l) => l,
|
||||
Err(e) => {
|
||||
eprintln!("CRITICAL ERROR: Failed to bind to {}: {}", addr, e);
|
||||
std::io::stderr().flush().unwrap();
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
println!("Server listener established. Serving app...");
|
||||
std::io::stdout().flush().unwrap();
|
||||
|
||||
axum::serve(listener, app).await.unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue