Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docker): remove chrome installation script
Ref: #32 (comment)
- Loading branch information
Showing
3 changed files
with
19 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,16 @@ | ||
FROM node:10-slim | ||
LABEL maintainer "spring-raining <harusamex.com@gmail.com>" | ||
|
||
# Revision number is referenced from puppeteer | ||
# https://github.com/GoogleChrome/puppeteer/releases | ||
ARG chromium_revision=564778 | ||
FROM node:12-slim | ||
LABEL maintainer "Vivliostyle Foundation <mail@vivliostyle.org>" | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
libasound2-dev libgtk-3-0 libnss3-dev libx11-xcb-dev libxss-dev libxtst-dev \ | ||
wget unzip \ | ||
&& cd /opt \ | ||
&& wget -q https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/${chromium_revision}/chrome-linux.zip \ | ||
&& unzip -q chrome-linux.zip \ | ||
&& chmod -R +rx chrome-linux \ | ||
&& ln -s /opt/chrome-linux/chrome /usr/local/bin/chromium-browser \ | ||
&& ln -s /opt/chrome-linux/chrome /usr/local/bin/chromium \ | ||
&& rm -rf /opt/chrome-linux.zip /var/lib/apt/lists/ /src/*.deb | ||
ghostscript poppler-utils | ||
|
||
ADD . /opt/vivliostyle-cli | ||
WORKDIR /opt/vivliostyle-cli | ||
COPY package.json yarn.lock /opt/vivliostyle-cli/ | ||
RUN yarn install | ||
COPY . /opt/vivliostyle-cli | ||
RUN yarn build && yarn link | ||
|
||
RUN groupadd -r vivliostyle \ | ||
&& useradd -s /bin/bash -r -m -g vivliostyle -G audio,video vivliostyle \ | ||
&& mkdir -p /home/vivliostyle/Downloads \ | ||
&& chown -R vivliostyle:vivliostyle /home/vivliostyle \ | ||
&& chown -R vivliostyle:vivliostyle /opt/vivliostyle-cli | ||
|
||
USER vivliostyle | ||
RUN set -x \ | ||
&& yarn install \ | ||
&& yarn build | ||
|
||
ENTRYPOINT [ "./dist/cli.js" ] | ||
CMD [] | ||
ENTRYPOINT [ "vivliostyle" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
default: test | ||
|
||
build: | ||
docker build -t vivliostyle/cli . | ||
|
||
test: build | ||
docker run --rm -it vivliostyle/cli build tests/fixtures/wood --no-sandbox -b -s A4 -o test.pdf | ||
|
||
run: build | ||
docker run --rm -it --entrypoint bash vivliostyle/cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters