minify static files (#9)
Co-authored-by: Felipe Contreras Salinas <felipe@bstr.cl> Reviewed-on: #9
This commit is contained in:
parent
d7c28bfa62
commit
d56fd92ee3
1 changed files with 7 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
##### Builder ####
|
||||
FROM rust:1.64-alpine as builder
|
||||
|
||||
RUN apk add --no-cache sqlite npm musl-dev
|
||||
RUN apk add --no-cache sqlite npm musl-dev fd minify
|
||||
|
||||
# Install Typescript
|
||||
RUN npm install -g typescript
|
||||
|
|
@ -47,6 +47,11 @@ RUN tsc
|
|||
# Delete the first line of jvascript ts-client
|
||||
RUN sed -i '1d' build/client.js
|
||||
|
||||
# Minify static files
|
||||
COPY static /usr/src/huellas/static/
|
||||
RUN fd -e html . '/usr/src/huellas/static/' -x minify -r -o {} {}
|
||||
RUN fd -e js . '/usr/src/huellas/ts-client/build/' -x minify -r -o {} {}
|
||||
|
||||
################
|
||||
##### Runtime
|
||||
FROM alpine:3.16 AS Runtime
|
||||
|
|
@ -59,7 +64,7 @@ COPY --from=builder /usr/src/huellas/target/release/huellas /usr/local/bin
|
|||
COPY Rocket.toml /usr/local/bin
|
||||
|
||||
# Copy static files
|
||||
COPY static /usr/local/bin/static/
|
||||
COPY --from=builder /usr/src/huellas/static /usr/local/bin/static/
|
||||
# Copy javascript client
|
||||
COPY --from=builder /usr/src/huellas/ts-client/build/client.js /usr/local/bin/static
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue