From 0e3e40d2a28a2120c2902e271e0af0ab55f812db Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Sun, 10 Mar 2024 14:46:41 -0300 Subject: [PATCH] fix: docker assets/ 404 (#15) * fix: docker assets/ 404 * chore(devcontainer): add docker-in-docker feature * chore: version 0.3.8 --- .devcontainer/devcontainer.json | 3 ++- Cargo.toml | 2 +- Dockerfile | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index eb1e48a..0e8123b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,8 @@ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/rust:latest", "features": { - "ghcr.io/devcontainers/features/node:latest": {} + "ghcr.io/devcontainers/features/node:latest": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2": {} }, // Use 'mounts' to make the cargo cache persistent in a Docker Volume. // "mounts": [ diff --git a/Cargo.toml b/Cargo.toml index d55f7c4..532c742 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stoic-quotes" -version = "0.3.7" +version = "0.3.8" edition = "2021" authors = ["Jose Storopoli "] description = "Stoic quotes API backend" diff --git a/Dockerfile b/Dockerfile index 26275e7..b492e09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,8 @@ WORKDIR /usr/src/app # Add labels for OCI annotations LABEL org.opencontainers.image.source="https://github.com/storopoli/stoic-quotes" \ - org.opencontainers.image.description="Stoic Quotes" \ - org.opencontainers.image.licenses="MIT" + org.opencontainers.image.description="Stoic Quotes" \ + org.opencontainers.image.licenses="MIT" # Copy project's Cargo.toml file COPY ./Cargo.toml ./ @@ -37,8 +37,12 @@ RUN cargo build --release --target x86_64-unknown-linux-musl # Start a new stage from a slim version of Debian to reduce the size of the final image FROM debian:buster-slim +WORKDIR /usr/src/app + # Copy the binary from the builder stage to the new stage COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/stoic-quotes /usr/local/bin/stoic-quotes +# Copy the assets/ from the builder stage to the new stage +COPY --from=builder /usr/src/app/assets /usr/src/app/assets # Expose port 3000 EXPOSE 3000