Skip to content

Commit

Permalink
refactor: rust docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Firgrep committed May 26, 2024
1 parent 000d875 commit 8c73f2a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
.git
.gitignore
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
CMD ["/caravan"]
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -48,7 +48,6 @@ async fn handle_signed_url(
Json(payload): Json<SignedUrlRequest>,
) -> Result<Json<SignUrlResponse>, StatusCode> {
let bucket = "symposia-dev-bucket";
// let object = "video/cluvqhyly0007uwfdmg2hn33a/VID_20200103_135115.mp4";

let object = payload.object;
let storage_client = &state.storage_client;
Expand Down

0 comments on commit 8c73f2a

Please sign in to comment.