This repository was archived by the owner on Nov 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
90 lines (73 loc) · 2.47 KB
/
Dockerfile
File metadata and controls
90 lines (73 loc) · 2.47 KB
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
#
# Copyright 2019 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
#
FROM node:10-alpine
LABEL Name=OAE-Hilary
LABEL Author=ApereoFoundation
LABEL Email=oae@apereo.org
RUN apk --update --no-cache add \
git \
python \
ghostscript \
graphicsmagick
# Installs the 3.8 Chromium package.
RUN apk update && apk upgrade && \
echo @3.8 http://nl.alpinelinux.org/alpine/v3.8/community >> /etc/apk/repositories && \
echo @3.8 http://nl.alpinelinux.org/alpine/v3.8/main >> /etc/apk/repositories && \
apk add --no-cache \
chromium@3.8 \
nss@3.8 \
freetype@3.8 \
harfbuzz@3.8 \
ttf-freefont@3.8
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Install libreoffice
RUN apk add --no-cache libreoffice openjdk8-jre
# install nodegit
RUN apk --update --no-cache add build-base libgit2-dev
RUN ln -s /usr/lib/libcurl.so.4 /usr/lib/libcurl-gnutls.so.4
# Set the base directory
ENV HILARY_DIR /usr/src/Hilary
RUN mkdir -p ${HILARY_DIR} \
&& chown -R node:node ${HILARY_DIR} \
&& chmod -R 755 ${HILARY_DIR}
WORKDIR ${HILARY_DIR}
# Create the temp directory for Hilary
ENV TMP /usr/src/tmp
RUN mkdir -p ${TMP} && export TMP=${TMP}
# Create the files directory for Hilary
ENV FILES ${TMP}/files
RUN mkdir -p ${FILES} && export FILES=${FILES}
# Make sure the tmp and files dir are readable by node
RUN chown -R node:node /usr/src
RUN chmod -R 755 /usr/src
# Expose ports for node server
EXPOSE 2000
EXPOSE 2001
USER node
# Run the app - you may override CMD via docker run command line instruction
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["nodemon -L app.js | bunyan"]