fix: docker build #24

Merged
pitbuster merged 1 commit from fix-docker into main 2023-05-22 22:59:59 -04:00
3 changed files with 7 additions and 9 deletions
Showing only changes of commit 2355fdc986 - Show all commits

View file

@ -1,2 +1,4 @@
.git .git
target target
db/huellas-test
db/*.wal

View file

@ -3,7 +3,6 @@ name = "huellas"
version = "0.2.1" version = "0.2.1"
edition = "2021" edition = "2021"
license = "AGPL-3.0" license = "AGPL-3.0"
links = "sqlite"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -1,10 +1,9 @@
##### Builder #### ##### 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 dependencies
RUN apk add --no-cache sqlite npm musl-dev fd minify && npm install -g typescript
# Install Typescript
RUN npm install -g typescript
WORKDIR /usr/src WORKDIR /usr/src
@ -24,7 +23,7 @@ RUN cargo build --release
COPY src /usr/src/huellas/src/ COPY src /usr/src/huellas/src/
COPY migrations /usr/src/huellas/migrations/ COPY migrations /usr/src/huellas/migrations/
COPY db /usr/src/huellas/db/ 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 ## Touch main.rs to prevent cached release build
RUN touch /usr/src/huellas/src/main.rs 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 application binary from builder image
COPY --from=builder /usr/src/huellas/target/release/huellas /usr/local/bin 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 static files
COPY --from=builder /usr/src/huellas/static /usr/local/bin/static/ COPY --from=builder /usr/src/huellas/static /usr/local/bin/static/