From 6917ccf487f2e7401cd711b0d7dd045f57666c15 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 16 Aug 2025 18:39:57 -0400 Subject: [PATCH] tsk-42: Dockerized the service --- Dockerfile | 2 +- docker-compose.yaml | 6 +++--- src/main.rs | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index d474b35..a562d6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,7 +59,7 @@ COPY --from=builder /usr/src/app/target/release/songparser . COPY --from=builder /usr/src/app/.env . # Expose the port your Axum app listens on (e.g., 3000 or 8000) -EXPOSE 3000 +# EXPOSE 3000 # Set the command to run your application # Ensure this matches the binary name copied above diff --git a/docker-compose.yaml b/docker-compose.yaml index 7651a5d..58d07b8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,14 +2,14 @@ version: '3.8' # Use a recent version services: # Your Rust Application Service - auth_api: + songparser: build: # Tells docker-compose to build the Dockerfile in the current directory context: . ssh: ["default"] # Uses host's SSH agent container_name: songparser # Optional: Give the container a specific name - ports: + # ports: # Map host port 8000 to container port 3000 (adjust as needed) - - "8002:3002" + # - "8002:3002" env_file: - .env restart: unless-stopped # Optional: Restart policy diff --git a/src/main.rs b/src/main.rs index 86b306c..7dac71c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,9 @@ async fn main() -> Result<(), Box> { auth_uri: icarus_envy::environment::get_icarus_auth_base_api_url().await, ..Default::default() }; + println!("Base URL: {:?}", app.uri); + println!("Auth URL: {:?}", app.auth_uri); + match auth::get_token(&app).await { Ok(login_result) => { app.token = login_result; @@ -27,8 +30,6 @@ async fn main() -> Result<(), Box> { }; loop { - println!("Base URL: {:?}", app.uri); - println!("Auth URL: {:?}", app.auth_uri); println!("Token: {:?}", app.token); if auth::did_token_expire(&app.token).await {