diff --git a/CHANGELOG.md b/CHANGELOG.md index 39920d325..e0259a52a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## UNRELEASED ## Fixed * Call summary Site summary in the slack plugin to make it easier to undestand. +* Run as root inside the Docker container, it makes things easier. ## 4.0.0-beta.6 2016-10-26 ### Added diff --git a/Dockerfile b/Dockerfile index 6cf728480..51e49cfe6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,11 @@ FROM sitespeedio/webbrowsers:firefox-49.0-chrome-54.0 -RUN useradd --user-group --create-home --shell /bin/false app && usermod -aG sudo app +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app -# Enable passwordless sudo for users under the "sudo" group -RUN sed -i.bkp -e \ - 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \ - /etc/sudoers - -ENV HOME=/home/app - -COPY package.json $HOME -RUN chown -R app:app $HOME/* - -USER app -WORKDIR $HOME +COPY package.json /usr/src/app/ RUN npm install --production - -USER root -COPY . $HOME - -RUN chown -R app:app $HOME/* -USER app +COPY . /usr/src/app COPY docker/scripts/start.sh /start.sh diff --git a/docker/scripts/start.sh b/docker/scripts/start.sh index b1a31aa49..5049a0592 100755 --- a/docker/scripts/start.sh +++ b/docker/scripts/start.sh @@ -10,4 +10,4 @@ echo 'Starting Xvfb ...' export DISPLAY=:99 2>/dev/null 1>&2 Xvfb :99 -ac -nolisten tcp -screen 0 1500x1200x16 & sleep 1 -exec node --max-old-space-size=$MAX_OLD_SPACE_SIZE /home/app/bin/sitespeed.js "$@" +exec node --max-old-space-size=$MAX_OLD_SPACE_SIZE /usr/src/app/bin/sitespeed.js "$@"