Skip to content

Commit f55f374

Browse files
committed
fix: Usuba docker reverse proxying
1 parent d8d2a58 commit f55f374

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ services:
66
tags:
77
- 'usuba:local'
88
network_mode: 'host'
9-
ports:
10-
- '8080:8080'
9+
environment:
10+
UPSTREAM: 'localhost:5173'

rust/usuba/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ RUN npm install -g @bytecodealliance/jco
4040
COPY --from=builder /build-root/target/release/usuba /usr/bin/usuba
4141

4242
ENV RUST_LOG="debug"
43+
ENV UPSTREAM="localhost:5173"
4344

4445
ENTRYPOINT ["/usr/bin/usuba"]

rust/usuba/src/bin/usuba.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ pub async fn main() -> Result<(), UsubaError> {
1414
.finish();
1515
tracing::subscriber::set_global_default(subscriber.with(Layer::default().pretty()))?;
1616

17-
let port = std::option_env!("PORT").unwrap_or("8080");
17+
let port = std::env::var("PORT").unwrap_or("8080".into());
1818
let socket_address: SocketAddr = format!("0.0.0.0:{port}").parse()?;
1919
let listener = tokio::net::TcpListener::bind(socket_address).await?;
20-
let upstream = std::option_env!("UPSTREAM")
20+
let upstream = std::env::var("UPSTREAM")
21+
.ok()
2122
.map(|upstream| upstream.parse().ok())
2223
.unwrap_or(None);
2324

typescript/packages/usuba-ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@commontools/usuba-sw": "^0.0.1",
2626
"@commontools/usuba-api": "^0.0.1",
2727
"typescript": "^5.2.2",
28+
"tslib": "^2.6.2",
2829
"vite": "^5.2.0",
2930
"wireit": "^0.14.4"
3031
},

0 commit comments

Comments
 (0)