diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b323fec --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +target +.git +.gitignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 36f17c1..c82a404 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,9 @@ -FROM golang:1.22 AS builder - -WORKDIR /app - +FROM messense/rust-musl-cross:x86_64-musl AS builder +WORKDIR /caravan COPY . . +RUN cargo build --release --target x86_64-unknown-linux-musl -RUN go mod download - -RUN go build -o caravan - +FROM scratch +COPY --from=builder /caravan/target/x86_64-unknown-linux-musl/release/caravan /caravan EXPOSE 8080 - -CMD ["./caravan"] \ No newline at end of file +CMD ["/caravan"] diff --git a/src/main.rs b/src/main.rs index a2c15ad..65ebec1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,7 +24,7 @@ async fn main() { .layer(ServiceBuilder::new().layer(Extension(shared_state))); // Run server - let listener = tokio::net::TcpListener::bind("127.0.0.1:3000") + let listener = tokio::net::TcpListener::bind("127.0.0.1:8080") .await .unwrap(); println!("listening on {}", listener.local_addr().unwrap()); @@ -48,7 +48,6 @@ async fn handle_signed_url( Json(payload): Json, ) -> Result, StatusCode> { let bucket = "symposia-dev-bucket"; - // let object = "video/cluvqhyly0007uwfdmg2hn33a/VID_20200103_135115.mp4"; let object = payload.object; let storage_client = &state.storage_client;