From bdb4e4194360234a02a5cbd37384d42cf0b26025 Mon Sep 17 00:00:00 2001 From: Felipe Date: Mon, 22 May 2023 22:59:58 -0400 Subject: [PATCH] fix: docker build (#24) Co-authored-by: Felipe Contreras Salinas Reviewed-on: https://oolong.ludwig.dog/pitbuster/huellas/pulls/24 --- .dockerignore | 2 ++ Cargo.toml | 1 - Dockerfile | 13 +++++-------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.dockerignore b/.dockerignore index 5874b8c..d7c2fc3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,4 @@ .git target +db/huellas-test +db/*.wal diff --git a/Cargo.toml b/Cargo.toml index d2ac76d..48811fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,6 @@ name = "huellas" version = "0.2.1" edition = "2021" license = "AGPL-3.0" -links = "sqlite" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/Dockerfile b/Dockerfile index 3c944f5..9bc982b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,9 @@ ##### Builder #### -FROM rust:1.64-alpine as builder +FROM rust:1.68-alpine as builder +ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse -RUN apk add --no-cache sqlite npm musl-dev fd minify - -# Install Typescript -RUN npm install -g typescript +# Install dependencies +RUN apk add --no-cache sqlite npm musl-dev fd minify && npm install -g typescript WORKDIR /usr/src @@ -24,7 +23,7 @@ RUN cargo build --release COPY src /usr/src/huellas/src/ COPY migrations /usr/src/huellas/migrations/ COPY db /usr/src/huellas/db/ -COPY .env sqlx-data.json Rocket.toml /usr/src/huellas/ +COPY .env /usr/src/huellas/ ## Touch main.rs to prevent cached release build RUN touch /usr/src/huellas/src/main.rs @@ -60,8 +59,6 @@ RUN apk add --no-cache sqlite # Copy application binary from builder image COPY --from=builder /usr/src/huellas/target/release/huellas /usr/local/bin -# Copy Rocket.toml -COPY Rocket.toml /usr/local/bin # Copy static files COPY --from=builder /usr/src/huellas/static /usr/local/bin/static/