From 047cc0971697d1059e2aa8cb7d32fc47c05c4e0f Mon Sep 17 00:00:00 2001 From: Emiliano Ciavatta Date: Wed, 16 Sep 2020 21:14:41 +0200 Subject: Fix dockerfile --- .dockerignore | 5 +++++ Dockerfile | 23 +++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c18c661 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +# pcaps +pcaps/*.pcap +pcaps/*.pcapng +pcaps/processing/*.pcap +pcaps/processing/*.pcapng diff --git a/Dockerfile b/Dockerfile index e3c49bc..cf7730b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,29 +3,28 @@ FROM ubuntu:20.04 AS BUILDSTAGE # Install tools and libraries RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -qq git golang-1.14 pkg-config libpcap-dev libhyperscan-dev yarnpkg curl - -RUN ln -sf ../lib/go-1.14/bin/go /usr/bin/go - + DEBIAN_FRONTEND=noninteractive apt-get install -qq golang-1.14 pkg-config libpcap-dev libhyperscan-dev yarnpkg COPY . /caronte WORKDIR /caronte -RUN go mod download && go build - -RUN cd frontend && \ +RUN ln -sf ../lib/go-1.14/bin/go /usr/bin/go && \ + go mod download && \ + go build && \ + cd frontend && \ yarnpkg install && \ - yarnpkg build --production=true -RUN curl -sf https://gobinaries.com/tj/node-prune | sh && cd /caronte/frontend && node-prune + yarnpkg build --production=true && \ + cd - && \ + mkdir -p /caronte-build/frontend && \ + cp -r caronte pcaps/ scripts/ shared/ test_data/ /caronte-build && \ + cp -r frontend/build/ /caronte-build/frontend # LAST STAGE FROM ubuntu:20.04 -COPY --from=BUILDSTAGE /caronte/caronte /caronte/caronte -COPY --from=BUILDSTAGE /caronte/frontend /caronte/frontend -COPY --from=BUILDSTAGE /caronte/shared /caronte/shared +COPY --from=BUILDSTAGE /caronte-build /caronte RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -qq libpcap-dev libhyperscan-dev && \ -- cgit v1.2.3-70-g09d2