run as root inside the container
This commit is contained in:
parent
58a8f04071
commit
7ac6cfc848
|
|
@ -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
|
||||
|
|
|
|||
23
Dockerfile
23
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 "$@"
|
||||
|
|
|
|||
Loading…
Reference in New Issue