fix: docker build
This commit is contained in:
parent
f63f3a5854
commit
2355fdc986
3 changed files with 7 additions and 9 deletions
|
|
@ -1,2 +1,4 @@
|
||||||
.git
|
.git
|
||||||
target
|
target
|
||||||
|
db/huellas-test
|
||||||
|
db/*.wal
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
13
Dockerfile
13
Dockerfile
|
|
@ -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/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue