fix: Dockerfile frontend build

Signed-off-by: zu1k <i@zu1k.com>
pull/37/head
zu1k 2022-12-05 10:12:15 +08:00
parent a9a1123f94
commit 8811a6b810
No known key found for this signature in database
GPG Key ID: AE381A8FB1EF2CC8
2 changed files with 9 additions and 9 deletions

View File

@ -1,8 +1,9 @@
index
.github
target
/release
*.csv
.git
.vscode/*
.idea
.DS_Store
.DS_Store

View File

@ -1,17 +1,16 @@
# docker build . -t ghcr.io/knatnetwork/zlib-searcher:latest
FROM node:19-bullseye as frontend
COPY ./frontend /frontend
RUN cd /frontend && npm install && npm run build
COPY . /source
RUN cd /source/frontend && npm install && npm run build
FROM rust:1.65-buster as backend
COPY . /app
COPY --from=frontend /frontend/dist /app/frontend/dist
RUN cd /app && cargo build --release -p zlib-searcher
COPY . /source
COPY --from=frontend /source/frontend/dist /source/frontend/dist
RUN cd /source && cargo build --release -p zlib-searcher
FROM ubuntu:22.04
COPY --from=backend /app/target/release/zlib-searcher /zlib-searcher
COPY --from=backend /source/target/release/zlib-searcher /zlib-searcher
CMD ["/zlib-searcher", "run", "-b", "0.0.0.0:7070"]