From edf4429dd706a21d2d130c88e37450221d2e7582 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Mon, 15 Nov 2021 12:24:39 +0000 Subject: [PATCH] from buster --- Dockerfile | 71 +++++++++++++++++++++++++++++++++++++++------- archive/Dockerfile | 19 +++++++++++++ 2 files changed, 80 insertions(+), 10 deletions(-) create mode 100644 archive/Dockerfile diff --git a/Dockerfile b/Dockerfile index 4d04280..d7067a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,70 @@ -from theiaide/theia-python:latest +ARG NODE_VERSION=17.1.0-buster-slim + +FROM node:${NODE_VERSION} +RUN apt-get update && apt-get install -y libsecret-1-dev +ARG version=latest +WORKDIR /home/theia +ADD $version.package.json ./package.json +ARG GITHUB_TOKEN +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:${NODE_VERSION} + +# Install Python 3 from source +ARG VERSION=3.8.3 RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y make build-essential libssl-dev \ + && apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ + && apt-get install -y libncurses5-dev libncursesw5-dev xz-utils tk-dev \ + && wget https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz \ + && tar xvf Python-$VERSION.tgz \ + && cd Python-$VERSION \ + && ./configure \ + && make -j8 \ + && make install \ + && cd .. \ + && rm -rf Python-$VERSION \ + && rm Python-$VERSION.tgz + +RUN apt-get update \ + && apt-get install -y libsecret-1-0 \ && apt-get -y install libgs-dev \ - && rm -rf /var/lib/apt/lists/* + && apt-get install -y python-dev python-pip \ + && pip install --upgrade pip --user \ + && apt-get install -y python3-dev python3-pip \ + && pip3 install --upgrade pip --user \ + && pip3 install python-language-server flake8 autopep8 \ + && pip3 install pytest pylint bandit black pytest-django six pytest-mock + && apt-get install -y yarn \ + && apt-get clean \ + && apt-get auto-remove -y \ + && rm -rf /var/cache/apt/* \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* # Install docker for the container to enable access to a docker host if socket is mounted RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-20.10.9.tgz \ && tar -xvf docker-20.10.9.tgz docker/docker && cp docker/docker /usr/bin/ -# Install Python requirements to support development -COPY ./config/requirements.txt . -run pip3 install --upgrade pip \ - && pip3 install -r requirements.txt \ - && pip3 install pytest pylint bandit flake8 black pytest-django six pytest-mock - - -#ENTRYPOINT node /home/theia/src-gen/backend/main.js /home/project/ --hostname=0.0.0.0 \ No newline at end of file +RUN mkdir -p /home/theia \ + && mkdir -p /home/project +ENV HOME /home/theia +WORKDIR /home/theia +COPY --from=0 /home/theia /home/theia +EXPOSE 3000 +ENV SHELL=/bin/bash \ + THEIA_DEFAULT_PLUGINS=local-dir:/home/theia/plugins +ENV USE_LOCAL_GIT true +ENTRYPOINT [ "node", "/home/theia/src-gen/backend/main.js", "/home/project", "--hostname=0.0.0.0" ] \ No newline at end of file diff --git a/archive/Dockerfile b/archive/Dockerfile new file mode 100644 index 0000000..4d04280 --- /dev/null +++ b/archive/Dockerfile @@ -0,0 +1,19 @@ +from theiaide/theia-python:latest + +RUN apt-get update \ + && apt-get -y install libgs-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install docker for the container to enable access to a docker host if socket is mounted +RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-20.10.9.tgz \ + && tar -xvf docker-20.10.9.tgz docker/docker && cp docker/docker /usr/bin/ + + +# Install Python requirements to support development +COPY ./config/requirements.txt . +run pip3 install --upgrade pip \ + && pip3 install -r requirements.txt \ + && pip3 install pytest pylint bandit flake8 black pytest-django six pytest-mock + + +#ENTRYPOINT node /home/theia/src-gen/backend/main.js /home/project/ --hostname=0.0.0.0 \ No newline at end of file