-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile
67 lines (58 loc) · 1.87 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM node:12-bullseye
RUN apt-get update && apt-get install -y libsecret-1-dev
WORKDIR /usr/local/theia
# From https://github.com/theia-ide/theia-apps/tree/master/theia-python-docker;
# modified applicationName "Theia Gopherbot IDE"
COPY theia/latest.package.json /usr/local/theia/package.json
RUN yarn --pure-lockfile && \
NODE_OPTIONS="--max_old_space_size=4096" yarn theia build && \
yarn theia download:plugins && \
yarn --production && \
yarn autoclean --init && \
echo *.ts >> .yarnclean && \
echo *.ts.map >> .yarnclean && \
echo *.spec.* >> .yarnclean && \
yarn autoclean --force && \
yarn cache clean
FROM node:12-bullseye
# Package for ruby & python extension development
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
bind9-dnsutils \
jq \
libsecret-1-0 \
python3-dev \
python3-pip \
ruby \
vim && \
pip3 install \
autopep8 \
flake8 \
pylint \
python-language-server && \
gem install \
irb && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/*
# Start common section
ENV ROBOT_UID=994
ENV SHELL=/bin/bash
ENV HOME=/var/lib/robot
ENV PATH=$PATH:${HOME}/bin:${HOME}/.local/bin:/opt/gopherbot
ENV RUBYLIB=/opt/gopherbot/lib
ENV PYTHONPATH=/opt/gopherbot/lib
RUN useradd -d ${HOME} -r -c "Gopherbot Robot" -u ${ROBOT_UID} robot && \
mkdir -p ${HOME} && \
chown robot:robot ${HOME} && \
chmod 0755 ${HOME}
USER ${ROBOT_UID}:${ROBOT_UID}
COPY --chown=${ROBOT_UID}:${ROBOT_UID} robot-bashrc ${HOME}/.bashrc
RUN ln -s /opt/gopherbot ${HOME}/robot-defaults && \
mkdir ${HOME}/bin
# End common section
WORKDIR /usr/local/theia
COPY --from=0 /usr/local/theia /usr/local/theia
EXPOSE 3000
# configure Theia
ENV THEIA_DEFAULT_PLUGINS=local-dir:/usr/local/theia/plugins
ENTRYPOINT [ "node", "/usr/local/theia/src-gen/backend/main.js", "/var/lib/robot", "--hostname=0.0.0.0" ]