forked from ulixee/secret-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
68 lines (55 loc) · 2.4 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM node:14-slim
ENV GO_URL https://golang.org/dl/go1.14.2.linux-amd64.tar.gz
# fonts
RUN echo "deb http://httpredir.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list \
&& echo "deb http://httpredir.debian.org/debian buster-updates main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb http://security.debian.org/ buster/updates main contrib non-free" >> /etc/apt/sources.list \
&& echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \
&& apt-get update \
&& apt-get install -y \
fonts-arphic-ukai \
fonts-arphic-uming \
fonts-ipafont-mincho \
fonts-thai-tlwg \
fonts-kacst \
fonts-ipafont-gothic \
fonts-unfonts-core \
ttf-wqy-zenhei \
ttf-mscorefonts-installer \
fonts-freefont-ttf \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
## TODO: randomize font installs and add from google https://gist.github.com/keeferrourke/d29bf364bd292c78cf774a5c37a791db
# Install Go for Mitm sockets
RUN set -eux; \
wget -O go.tgz "${GO_URL}" -q --progress=bar; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
export PATH="/usr/local/go/bin:$PATH"; \
go version
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR /app/secret-agent
# NOTE: You must run yarn build:docker from root for this to work
COPY ./build-dist /app/secret-agent/
RUN cat /etc/*-release
# Add user so we don't need --no-sandbox.
# same layer as yarn install to keep re-chowned files from using up several hundred MBs more space
# NOTE: this installs the monorepo, but you could also install secret-agent directly + and desired browsers
# we will automatically install dependencies
RUN cd /app/secret-agent && yarn \
&& $(npx install-browser-deps) \
&& groupadd -r sagent && useradd -r -g sagent -G audio,video sagent \
&& mkdir -p /home/sagent/Downloads \
&& mkdir -p /home/sagent/.cache \
&& chown -R sagent:sagent /home/sagent \
&& chown -R sagent:sagent /app/secret-agent \
&& mv ~/.cache/secret-agent /home/sagent/.cache/ \
&& chmod 777 /tmp \
&& chmod -R 777 /home/sagent/.cache/secret-agent
# Add below to run as unprivileged user.
USER sagent
CMD node core/start;
# To run this docker, please see /tools/docker/docker-run.sh