-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
64 lines (53 loc) · 1.89 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
# See https://caddyserver.com/docs/ for info on Caddy Server
FROM caddy:builder as caddy-build
RUN xcaddy build \
--with github.com/greenpau/caddy-security \
--with github.com/greenpau/caddy-trace
FROM ubuntu
# deadsnakes asks for your region, so we need to tell it to be non-interactive
ENV DEBIAN_FRONTEND=noninteractive
# install dependencies for Theia IDE
RUN apt update -y \
&& apt install -y software-properties-common gpg \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt update -y \
&& apt install -y vim \
tmux \
git \
curl \
gcc \
g++ \
make \
docker.io \
libsecret-1-dev \
libx11-dev \
libxkbfile-dev \
supervisor \
python3.9 \
python3-pip \
python3.9-dev \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt install -y nodejs \
&& npm install --global yarn
# IDE will live in the .browser-ide directory
RUN mkdir /.browser-ide
WORKDIR /.browser-ide
# Build the IDE
COPY package.json .
COPY ./browser-ide/preloadTemplate.html preloadTemplate.html
RUN yarn
RUN yarn build
# Get the caddy server executable with auth plugin enabled
COPY --from=caddy-build /usr/bin/caddy /usr/bin/caddy
# Get auxiliary files for Caddy server and process manager
COPY ./browser-ide/supervisor.conf /etc/
COPY ./browser-ide/Caddyfile /etc/
# Set some environment variables for the IDE
ENV THEIA_MINI_BROWSER_HOST_PATTERN={{hostname}}
ENV THEIA_WEBVIEW_EXTERNAL_ENDPOINT={{hostname}}
ENV SHELL=/bin/bash \
THEIA_DEFAULT_PLUGINS=local-dir:/.browser-ide/plugins
# add a non-root user if you want
# RUN useradd -ms /bin/bash myuser
# USER myuser
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor.conf"]