Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pagedjs-cli
Manage
Activity
Members
Labels
Plan
Issues
62
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pagedjs
pagedjs-cli
Commits
39f005f8
Commit
39f005f8
authored
5 years ago
by
Fred Chasen
Browse files
Options
Downloads
Patches
Plain Diff
Add Dockerfile
parent
2896e827
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#30150
failed with stages
in 3 seconds
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Dockerfile
+85
-0
85 additions, 0 deletions
Dockerfile
README.md
+10
-1
10 additions, 1 deletion
README.md
docker-font.conf
+13
-0
13 additions, 0 deletions
docker-font.conf
package-lock.json
+1
-1
1 addition, 1 deletion
package-lock.json
seccomp.json
+1535
-0
1535 additions, 0 deletions
seccomp.json
with
1644 additions
and
2 deletions
Dockerfile
0 → 100644
+
85
−
0
View file @
39f005f8
FROM
node:10-stretch
# Application parameters and variables
ENV
NODE_ENV=development
ENV
PORT=9090
ENV
DIRECTORY /home/node/pagedjs-cli
# Configuration for Chrome
ENV
CONNECTION_TIMEOUT=60000
ENV
CHROME_PATH=/usr/bin/google-chrome
# Configuration for GS4JS
ENV
GS4JS_HOME=/usr/lib/x86_64-linux-gnu
# Install ghostscript
RUN
apt-get update
&&
\
apt-get
install
-y
build-essential make gcc g++
&&
\
apt-get
-y
install
ghostscript
&&
apt-get clean
&&
\
apt-get
install
-y
libgs-dev
&&
\
rm
-rf
/var/lib/apt/lists/
*
# See https://crbug.com/795759
RUN
apt-get update
&&
apt-get
install
-yq
libgconf-2-4
# Update Freetype
COPY
docker-font.conf /etc/fonts/local.conf
ENV
FREETYPE_PROPERTIES="truetype:interpreter-version=35"
RUN
apt-get update
\
&&
sh
-c
'echo "deb http://http.us.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list'
\
&&
apt-get update
\
&&
apt-get
install
-y
ttf-mscorefonts-installer
\
--no-install-recommends
\
&&
rm
-rf
/var/lib/apt/lists/
*
# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
# installs, work.
RUN
apt-get update
&&
apt-get
install
-y
wget
--no-install-recommends
\
&&
wget
-q
-O
- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
\
&&
sh
-c
'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome-unstable.list'
\
&&
apt-get update
\
&&
apt-get
install
-y
google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont
\
--no-install-recommends
\
&&
rm
-rf
/var/lib/apt/lists/
*
\
&&
apt-get purge
--auto-remove
-y
curl
\
&&
rm
-rf
/src/
*
.deb
# helps prevent zombie chrome processes.
ADD
https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
RUN
chmod
+x /usr/local/bin/dumb-init
RUN
apt-get update
&&
\
apt-get
install
-y
vim
&&
\
rm
-rf
/var/lib/apt/lists/
*
RUN
npm
install
npm@latest
-g
RUN
npm
install
-g
node-gyp
RUN
mkdir
-p
$DIRECTORY
# Add user so we don't need --no-sandbox.
# RUN groupadd -r node && useradd -r -g node -G audio,video node \
RUN
adduser node audio
\
&&
adduser node video
\
&&
mkdir
-p
/home/node/Downloads
\
&&
chown
-R
node:node /home/node
\
&&
chown
-R
node:node /usr/lib
\
&&
chown
-R
node:node
$DIRECTORY
# Run everything after as non-privileged user.
USER
node
WORKDIR
$DIRECTORY
COPY
--chown=node:node package.json $DIRECTORY
RUN
npm
install
RUN
npm
install
ghostscript4js
COPY
--chown=node:node . $DIRECTORY
EXPOSE
$PORT
ENTRYPOINT
["dumb-init", "--"]
CMD
["./bin/paged"]
This diff is collapsed.
Click to expand it.
README.md
+
10
−
1
View file @
39f005f8
...
@@ -75,6 +75,15 @@ mocha
...
@@ -75,6 +75,15 @@ mocha
```
```
## Docker
## Docker
Build the Docker image
```
bash
docker build
-t
pagedmedia/pagedjs-cli .
```
Run the Docker image
```
bash
```
bash
docker run
-it
-
P
-v
$(
pwd
)
:/usr/src/pagedjs-cli fchasen
/pagedjs-cli bash
docker run
-it
-
-security-opt
'seccomp=seccomp.json'
pagedmedia
/pagedjs-cli bash
```
```
This diff is collapsed.
Click to expand it.
docker-font.conf
0 → 100644
+
13
−
0
View file @
39f005f8
<?
xml
version
=
"1.0"
?>
<!
DOCTYPE
fontconfig
SYSTEM
"fonts.dtd"
>
<
fontconfig
>
<
match
target
=
"font"
>
<
edit
name
=
"antialias"
mode
=
"assign"
><
bool
>
true
</
bool
></
edit
>
</
match
>
<
match
target
=
"font"
>
<
edit
name
=
"hintstyle"
mode
=
"assign"
><
const
>
hintnone
</
const
></
edit
>
</
match
>
<
match
target
=
"font"
>
<
edit
mode
=
"assign"
name
=
"hinting"
><
bool
>
false
</
bool
></
edit
>
</
match
>
</
fontconfig
>
This diff is collapsed.
Click to expand it.
package-lock.json
+
1
−
1
View file @
39f005f8
{
{
"name"
:
"pagedjs-cli"
,
"name"
:
"pagedjs-cli"
,
"version"
:
"0.0.
8
"
,
"version"
:
"0.0.
9
"
,
"lockfileVersion"
:
1
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"requires"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
...
...
This diff is collapsed.
Click to expand it.
seccomp.json
0 → 100644
+
1535
−
0
View file @
39f005f8
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment