Files
dev_environment/Dockerfile

78 lines
2.7 KiB
Docker

# Node Verion 12 ist für manche Theia Pakete erforderlich. Update muss getestet werden
ARG NODE_VERSION=12.22
# -buster-slim
# Builder Schritt hier wird das Package von Theia compiliert.
FROM node:${NODE_VERSION}
RUN apt-get update && apt-get install -y wget make build-essential libsecret-1-dev
ARG version=latest
WORKDIR /home/theia
ADD latest.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
ARG NODE_VERSION=12.22
#-buster-slim
# Paket erzeugen und Requirements installieren
FROM node:${NODE_VERSION}
# Install Python 3 from source
ARG VERSION=3.9.8
# Benötigte Pakete und Python 3 installieren
# Die Packages
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 \
&& apt-get install -y libsecret-1-0 \
&& apt-get -y install libgs-dev \
&& 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
# No Docker Deamon is installed at the moment
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/
# Erzeuge Arbeitsverzeichnis in home
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" ]