mirror of
https://codeberg.org/JasterV/chat-rooms-actix.git
synced 2026-04-26 18:10:04 +00:00
commit
45fd087ad2
6 changed files with 623 additions and 426 deletions
3
.dockerignore
Normal file
3
.dockerignore
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
*
|
||||
!src
|
||||
!Cargo.*
|
||||
1017
Cargo.lock
generated
1017
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -8,11 +8,11 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
actix = "0.10.0"
|
||||
actix-web = "3"
|
||||
actix-web = "3.3.3"
|
||||
actix-web-actors = "3.0.0"
|
||||
uuid = { version = "0.8", features = ["serde", "v4"] }
|
||||
derive_more = "0.99.11"
|
||||
uuid = { version = "1.10.0", features = ["serde", "v4"] }
|
||||
derive_more = { version = "1.0.0", features = ["full"] }
|
||||
serde_json = "1.0.64"
|
||||
serde = "1.0.124"
|
||||
env_logger = "0.8.3"
|
||||
env_logger = "0.11.5"
|
||||
rand = "0.8.3"
|
||||
12
Dockerfile
12
Dockerfile
|
|
@ -1,4 +1,4 @@
|
|||
FROM rust:1.50.0 as build
|
||||
FROM rust:1.78.0 as build
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
|
@ -6,8 +6,12 @@ RUN cargo build --release
|
|||
RUN mkdir -p /build-out
|
||||
RUN cp target/release/actix-messaging /build-out/
|
||||
|
||||
# Ubuntu 18.04
|
||||
FROM ubuntu:18.04 as production
|
||||
# Ubuntu 24.10
|
||||
FROM ubuntu:24.10 as production
|
||||
|
||||
RUN apt-get update && apt-get -y install ca-certificates libssl-dev && rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=build /build-out/* /
|
||||
COPY --from=build /build-out/actix-messaging /usr/local/bin/actix-messaging
|
||||
|
||||
ENV PORT=8080
|
||||
|
||||
ENTRYPOINT [ "/usr/local/bin/actix-messaging" ]
|
||||
|
|
@ -14,6 +14,13 @@ cargo build
|
|||
cargo run
|
||||
```
|
||||
|
||||
## Test with docker
|
||||
|
||||
```sh
|
||||
docker build ./ -t actix-chat
|
||||
docker run --rm -p 8080:8080 actix-chat
|
||||
```
|
||||
|
||||
## How to interact with the app
|
||||
|
||||
### Connect
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub enum Command {
|
|||
}
|
||||
|
||||
#[derive(Debug, Display, Error)]
|
||||
#[display(fmt = "Invalid command: {}", msg)]
|
||||
#[display("Invalid command: {}", msg)]
|
||||
pub struct CommandError {
|
||||
msg: &'static str,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue