35 lines
944 B
Docker
35 lines
944 B
Docker
# build image
|
|
FROM rust:latest as build
|
|
|
|
RUN rustup target add wasm32-unknown-unknown
|
|
RUN cargo install trunk wasm-bindgen-cli
|
|
|
|
RUN apt-get update && apt-get install -y npm binaryen libpq5 && npm install -g sass
|
|
|
|
WORKDIR /app/src
|
|
COPY . .
|
|
|
|
RUN cd frontend && trunk build --release
|
|
RUN cargo build --release
|
|
|
|
|
|
# production image
|
|
|
|
#FROM gcr.io/distroless/cc-debian10
|
|
#COPY --from=build /usr/lib/*/libpq.so.5 /app/lib/
|
|
#COPY --from=build /usr/lib/*/libgssapi_krb5.so.2 /app/lib/
|
|
#COPY --from=build /usr/lib/*/libldap_r-2.4.so.2 /app/lib/
|
|
#COPY --from=build /usr/lib/*/libkrb5.so.3 /app/lib/
|
|
#COPY --from=build /usr/lib/*/libk5crypto.so.3 /app/lib/
|
|
#COPY --from=build /usr/lib/*/libcom_err.* /app/lib/
|
|
#ENV LD_LIBRARY_PATH=/app/lib/
|
|
|
|
FROM ubuntu:latest
|
|
RUN apt-get update && apt-get install -y libpq5
|
|
|
|
COPY --from=build /app/src/target/release/backend /app/backend
|
|
COPY --from=build /app/src/frontend/dist /app/dist
|
|
|
|
WORKDIR /app
|
|
CMD ["./backend"]
|