-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathContainerfile
45 lines (30 loc) · 1015 Bytes
/
Containerfile
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
36
37
38
39
40
41
42
43
44
45
FROM fedora:36 AS build
RUN dnf install -y wget wireshark-cli nodejs chromium make gcc g++ python python-pip python-brotli
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video,wireshark pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser
# Download mitmdump
RUN mkdir mitmproxy && cd mitmproxy \
&& wget -q https://snapshots.mitmproxy.org/8.0.0/mitmproxy-8.0.0-linux.tar.gz -O mitmproxy.tar.gz \
&& tar xf mitmproxy.tar.gz && rm mitmproxy.tar.gz && cd - \
&& mkdir -p /app/bin \
&& cp /mitmproxy/* /app/bin/ \
&& chown pptruser. -R /app
RUN pip install mitmproxy==8.0.0
WORKDIR /app
USER pptruser
# Copy and install package.json first so it can be cached
COPY --chown=pptruser package*.json ./
#RUN npm i
RUN npm i --include=dev
COPY --chown=pptruser . ./
USER pptruser
# Run
# ===
FROM build AS run
ENTRYPOINT ["npm", "run", "start"]
# Test
# ====
FROM build AS test
#RUN npm i --include=dev
ENTRYPOINT ["npm", "run", "test"]