-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
36 lines (25 loc) · 960 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM node:22 as build
RUN apt-get -y update && \
apt-get -y install libpcap-dev default-jdk-headless
RUN npm install -g shadow-cljs
# Separate npm and clojure deps from main app build
RUN mkdir -p /app
ADD shadow-cljs.edn package.json /app/
RUN cd /app && npm --unsafe-perm install
RUN cd /app && shadow-cljs info
# main app build
ADD src/ /app/src/
ADD test/ /app/test/
RUN cd /app && \
shadow-cljs compile simple-client pool-server mac2ip-server ping-client read-pcap test && \
chmod +x build/*.js
FROM build as dev
RUN apt-get -y install tcpdump
RUN apt-get -y install isc-dhcp-client isc-dhcp-server iputils-ping curl iproute2
RUN curl -L https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -o /usr/local/bin/lein && \
chmod +x /usr/local/bin/lein
FROM node:22-slim as run
RUN apt-get -y update
RUN apt-get -y install libpcap-dev tcpdump iputils-ping curl iproute2
ENTRYPOINT []
COPY --from=build /app/ /app/