docker compat

This commit is contained in:
AF 2024-03-19 12:10:56 +00:00
parent 6a41d9c956
commit 0928a24ec1
4 changed files with 14 additions and 3 deletions

View File

@ -2,4 +2,5 @@ target
.git
.dockerignore
.gitignore
docker-compose.yml
Dockerfile

View File

@ -1,4 +1,7 @@
FROM rust:1.76
WORKDIR /code
COPY . .
RUN cargo build --release
CMD ["cargo", "run", "--release"]
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=./target \
cargo build --release && cp target/release/protohacke-rs /bin/protohacke-rs
CMD ["/bin/protohacke-rs"]

7
docker-compose.yml Normal file
View File

@ -0,0 +1,7 @@
services:
protohacke-rs:
build: .
ports:
- "42042:42042/tcp"
tty: true
stop_signal: SIGKILL

View File

@ -81,7 +81,7 @@ impl Sink<Vec<u8>> for Forward {
fn main() -> miette::Result<()> {
smol::block_on(async {
smol::net::TcpListener::bind("localhost:42042")
smol::net::TcpListener::bind("0.0.0.0:42042")
.await
.into_diagnostic()?
.incoming()