diff --git a/docker/Cargo.toml b/docker/Cargo.toml index 7ac9496..354927e 100644 --- a/docker/Cargo.toml +++ b/docker/Cargo.toml @@ -3,7 +3,8 @@ name = "docker_sample" version = "1.0.0" edition = "2021" +# Do not use workspace deps as they won't work in docker context. [dependencies] -actix-web.workspace = true -env_logger.workspace = true -log.workspace = true +actix-web = "4" +env_logger = "0.11" +log = "0.4" diff --git a/docker/Dockerfile b/docker/Dockerfile index 54310f0..b613ad3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,7 +3,7 @@ ################# ## build stage ## ################# -FROM rust:1-slim-bullseye AS builder +FROM rust:1-slim-bookworm AS builder WORKDIR /code # Download crates-io index and fetch dependency code. @@ -22,7 +22,7 @@ RUN cargo build --release ############### ## run stage ## ############### -FROM debian:bullseye-slim +FROM bitnami/minideb:bookworm WORKDIR /app # copy server binary from build stage diff --git a/docker/README.MD b/docker/README.md similarity index 55% rename from docker/README.MD rename to docker/README.md index 187d4c2..4666b90 100644 --- a/docker/README.MD +++ b/docker/README.md @@ -3,13 +3,13 @@ ## Build image ```shell -docker build -t docker_sample . +docker build -t actix-docker . ``` ## Run built image ```shell -docker run -d -p 8080:8080 docker_sample +docker run -d -p 8080:8080 actix-docker # and the server should start instantly curl http://localhost:8080 ``` @@ -17,6 +17,6 @@ curl http://localhost:8080 ## Running unit tests ```shell -docker build -t docker_sample:test . -docker run --rm docker_sample:test +docker build -t actix-docker:test . +docker run --rm actix-docker:test ```