docker compat
This commit is contained in:
parent
6a41d9c956
commit
0928a24ec1
@ -2,4 +2,5 @@ target
|
|||||||
.git
|
.git
|
||||||
.dockerignore
|
.dockerignore
|
||||||
.gitignore
|
.gitignore
|
||||||
|
docker-compose.yml
|
||||||
Dockerfile
|
Dockerfile
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
FROM rust:1.76
|
FROM rust:1.76
|
||||||
|
WORKDIR /code
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN cargo build --release
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
CMD ["cargo", "run", "--release"]
|
--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
7
docker-compose.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
services:
|
||||||
|
protohacke-rs:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "42042:42042/tcp"
|
||||||
|
tty: true
|
||||||
|
stop_signal: SIGKILL
|
@ -81,7 +81,7 @@ impl Sink<Vec<u8>> for Forward {
|
|||||||
|
|
||||||
fn main() -> miette::Result<()> {
|
fn main() -> miette::Result<()> {
|
||||||
smol::block_on(async {
|
smol::block_on(async {
|
||||||
smol::net::TcpListener::bind("localhost:42042")
|
smol::net::TcpListener::bind("0.0.0.0:42042")
|
||||||
.await
|
.await
|
||||||
.into_diagnostic()?
|
.into_diagnostic()?
|
||||||
.incoming()
|
.incoming()
|
||||||
|
Loading…
Reference in New Issue
Block a user