From 7c95dcc65416ceacccf4e6d24cf54e2bda37a923 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Thu, 3 Feb 2022 19:15:40 +0100 Subject: [PATCH] Add missing files --- .gitignore | 1 - env/bitbucket/Dockerfile | 101 ++++++++++++++++++++++++++++++ env/bitbucket/prepare_for_test.sh | 10 +++ 3 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 env/bitbucket/Dockerfile create mode 100755 env/bitbucket/prepare_for_test.sh diff --git a/.gitignore b/.gitignore index a9f70e96..d19db2b9 100644 --- a/.gitignore +++ b/.gitignore @@ -67,7 +67,6 @@ target/ # Environments .venv venv/ -ENV/ # Rope project settings .ropeproject diff --git a/env/bitbucket/Dockerfile b/env/bitbucket/Dockerfile new file mode 100644 index 00000000..d892093e --- /dev/null +++ b/env/bitbucket/Dockerfile @@ -0,0 +1,101 @@ +# create a new version of this docker image +# > docker build -t iterativ/vbv-lernwelt-bitbucket . +# push new version to Docker Hub +# > docker push iterativ/vbv-lernwelt-bitbucket +# run locally with directory mounted +# > docker run -v $(dirname "$(pwd)"):/src -it iterativ/vbv-lernwelt-bitbucket /bin/bash + +FROM python:3.10-bullseye +MAINTAINER Daniel Egger + +ARG DEBIAN_FRONTEND=noninteractive + +# Install node prereqs, nodejs and yarn +# Ref: https://deb.nodesource.com/setup_16.x +# Ref: https://yarnpkg.com/en/docs/install +# https://github.com/nikolaik/docker-python-nodejs +RUN \ + echo "deb https://deb.nodesource.com/node_16.x bullseye main" > /etc/apt/sources.list.d/nodesource.list && \ + wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \ + wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + apt-get update && \ + apt-get install -yqq nodejs yarn && \ + pip install -U pip && pip install pipenv && \ + npm i -g npm@^6 + +# Install Cypress deps +# https://github.com/cypress-io/cypress-docker-images/blob/master/base/16.5.0/Dockerfile +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + libgtk2.0-0 \ + libgtk-3-0 \ + libnotify-dev \ + libgconf-2-4 \ + libgbm-dev \ + libnss3 \ + libxss1 \ + libasound2 \ + libxtst6 \ + xauth \ + xvfb \ + # install text editors + vim-tiny \ + nano \ + # install emoji font + fonts-noto-color-emoji \ + # install Chinese fonts + # this list was copied from https://github.com/jim3ma/docker-leanote + fonts-arphic-bkai00mp \ + fonts-arphic-bsmi00lp \ + fonts-arphic-gbsn00lp \ + fonts-arphic-gkai00mp \ + fonts-arphic-ukai \ + fonts-arphic-uming \ + ttf-wqy-zenhei \ + ttf-wqy-microhei \ + xfonts-wqy \ + +RUN npm --version + +RUN npm install -g yarn@latest --force +RUN yarn --version + +# a few environment variables to make NPM installs easier +# good colors for most applications +ENV TERM xterm +# avoid million NPM install messages +ENV npm_config_loglevel warn +# allow installing when the main user is root +ENV npm_config_unsafe_perm true + +# Node libraries +RUN node -p process.versions + +# Show where Node loads required modules from +RUN node -p 'module.paths' + +# install postgresql + RUN apt-get install -y postgresql postgresql-contrib libpq-dev + +# Required by python3-saml + RUN apt-get -y install libxmlsec1-dev pkg-config gettext + +# install git-crypt +RUN apt-get -y install git-crypt + +ENV LANG C.UTF-8 +ENV LC_ALL C.UTF-8 + +# Install Google Chrome +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - +RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' +RUN apt-get update && apt-get install -y google-chrome-stable + +# versions of local tools +RUN echo " node version: $(node -v) \n" \ +"npm version: $(npm -v) \n" \ +"yarn version: $(yarn -v) \n" \ +"python version: $(python --version) \n" \ +"debian version: $(cat /etc/debian_version) \n" \ +"user: $(whoami) \n" diff --git a/env/bitbucket/prepare_for_test.sh b/env/bitbucket/prepare_for_test.sh new file mode 100755 index 00000000..1c06d7ae --- /dev/null +++ b/env/bitbucket/prepare_for_test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# needed for some tests +export LC_ALL=C.UTF-8 +export LANG=C.UTF-8 + +export PG_USER="postgres" +export PG_PORT=5432 + +export OPENSSL_CONF=/etc/ssl/