Commit 29fa12d9 authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

added Puppeteer and Chromium dependencies

parent 67c79a93
Pipeline #32754 failed with stages
in 9 minutes and 49 seconds
......@@ -27,7 +27,7 @@ build:
- docker build ./mc_frontend -t $FRONTEND_IMAGE
- docker push $FRONTEND_IMAGE
- docker build ./mc_frontend -t $BACKEND_IMAGE
- docker build ./mc_backend -t $BACKEND_IMAGE
- docker push $BACKEND_IMAGE
......@@ -42,7 +42,7 @@ ci_frontend:
- docker:20.10.8-dind
stage: ci
- docker run --rm --entrypoint="npm run test-ci" $FRONTEND_IMAGE > ci_frontend.log
- docker run --rm $FRONTEND_IMAGE npm run test-ci > ci_frontend.log
docker-compose build
docker-compose run --rm --entrypoint="npm run test-ci" mc_frontend > ci_frontend.log
docker-compose run --rm mc_frontend npm run test-ci > ci_frontend.log
docker-compose run --rm --entrypoint="./" mcserver > ci_backend.log
cat coverage.log
......@@ -17,6 +17,7 @@ services:
entrypoint: ng build --prod app
- CHROME_BIN=google-chrome
image: konstantinschulz/mc_frontend:latest
- ./mc_frontend/www:/home/mc/mc_frontend/www
......@@ -30,6 +31,7 @@ services:
- PYTHONPATH=/home/mc
image: konstantinschulz/mcserver:latest
- "5000:5000"
restart: always
FROM node:14.17.6-stretch-slim as BUILD_IMAGE
# python version in this container is 3.5.3
RUN useradd -ms /bin/bash mc
WORKDIR /home/mc
RUN apt update
# for testing with headless chrome browser
RUN apt install -y wget
RUN wget
RUN apt install -y ./google-chrome-stable_current_amd64.deb
FROM node:14.17.6-slim as BUILD_IMAGE
WORKDIR /home/mc/mc_frontend
COPY package.json .
RUN npm install
## use multi-stage image to reduce Docker image size
#FROM python:3.8-slim as PYTHON_IMAGE
#WORKDIR /home/mc/mc_frontend
#RUN apt update
#RUN apt install -y git
#COPY src src
#RUN python3
FROM node:14.17.6-stretch-slim
FROM node:14.17.6-slim
WORKDIR /home/mc/mc_frontend
RUN apt-get update
# install Chromium dependencies
RUN apt-get install -y libasound2 libatk1.0-0 libatk-bridge2.0-0 libcairo2 libcups2 libdrm-dev libgbm1 libnss3 \
libpango-1.0-0 libxcomposite1 libxdamage1 libxkbcommon-dev libxrandr2 libxshmfence-dev
# copy package.json so we can generate a clean lock file
COPY package.json .
# add Puppeteer manually because it will also install Chromium
RUN npm install -D puppeteer
COPY --from=BUILD_IMAGE /home/mc/mc_frontend/node_modules node_modules
# to get the version of the local CLI package, run: npm list @angular/cli | sed 's/[^0-9.]*//g' | sed -n 2p
RUN npm i -g @angular/cli
# this makes the analytics prompt during upcoming "npm install" disappear, so this can also run in CI
RUN ng analytics off
COPY . .
#COPY --from=PYTHON_IMAGE /home/mc/mc_frontend/src/version.ts src/version.ts
COPY ./config.xml ./www/config.xml
# workaround to fix the missing binding issue for node-sass
RUN npm rebuild node-sass
This diff is collapsed.
......@@ -72,6 +72,7 @@
"karma-jasmine": "^3.1.1",
"karma-jasmine-html-reporter": "^1.5.2",
"protractor": "^5.4.3",
"puppeteer": "^10.4.0",
"ts-node": "^8.1.1",
"tslint": "~5.16.0",
"typescript": "^3.6.5"
// Karma configuration file, see link for more information
const process = require('process');
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) {
basePath: '',
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment