-
Notifications
You must be signed in to change notification settings - Fork 96
/
Dockerfile
95 lines (80 loc) · 2.4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#
# Copyright 2018 Apereo Foundation (AF) Licensed under the
# Educational Community License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may
# obtain a copy of the License at
#
# http://opensource.org/licenses/ECL-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS"
# BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# Heavily based on:
# - https://hub.docker.com/r/bwits/pdf2htmlex-alpine
# - https://gist.github.com/Rockstar04/c77f9f46f15be7b156aaed9a34bb5188
#
# Setup in two steps
#
# Step 1: Build the image
# $ docker build -f Dockerfile -t oae-hilary:latest .
# Step 2: Run the docker
# $ docker run -it --name=hilary --net=host oae-hilary:latest
#
# This tag corresponds to node 15.x and alpine 3.11
FROM node:15.2.1-alpine3.11
LABEL Name=OAE-Hilary
LABEL Author=ApereoFoundation
LABEL [email protected]
# Avoid prompt when using npx
ENV npm_config_yes true
# Upgrade system libraries
RUN apk update ; apk upgrade
# Install system dependencies
RUN apk --no-cache add \
curl \
git \
build-base \
make \
python2 \
ghostscript \
libreoffice \
vips \
ca-certificates \
openjdk8-jre
# Installs latest Chromium
RUN apk --no-cache add \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Set the Hilary directory
ENV CODE_DIR /usr/src
ENV HILARY_DIR ${CODE_DIR}/Hilary
RUN mkdir -p ${HILARY_DIR}
WORKDIR ${HILARY_DIR}
# Set the right permissions for Hilary
RUN chown -R node:node ${CODE_DIR} \
&& chmod -R 755 ${CODE_DIR}
# Create the temp directory for Hilary
ENV TMP_DIR /tmp
RUN mkdir -p ${TMP_DIR}
RUN chown -R node:node ${TMP_DIR} \
&& chmod -R 755 ${TMP_DIR} \
&& export TMP=${TMP_DIR}
# Expose ports for node server
EXPOSE 2000
EXPOSE 2001
# Change user from now on
USER node
# Run the app - you may override CMD via docker run command line instruction
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["node app.js | bunyan"]