-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
71 lines (59 loc) · 1.91 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
FROM debian:jessie
MAINTAINER Michał "rysiek" Woźniak <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
ENV ETHERPAD_VERSION 1.5.7
# install the required packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
nodejs \
git-core \
curl \
python \
libssl-dev \
pkg-config \
build-essential \
ca-certificates \
npm \
tidy \
abiword \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# yeah, we need that because bin/installDeps.sh looks for node
# and debian has nodejs
RUN ln -s /usr/bin/nodejs /usr/bin/node
# yay, clone the repo!
RUN git clone -b "release/$ETHERPAD_VERSION" --single-branch https://github.com/ether/etherpad-lite.git /opt/etherpad && \
rm -rf /opt/etherpad/.git
# make it sane, security-wise
RUN groupadd -r etherpad && \
useradd -d /opt/etherpad -r -g `getent group etherpad | cut -d: -f3` etherpad && \
mkdir -p /opt/etherpad/config && \
chown -R etherpad:etherpad /opt/etherpad
# install the deps
# sync used due to a bug in Docker, working around "text file busy" error
RUN cd /opt/etherpad/ && \
chown -R etherpad:etherpad ./ && \
sync && \
bin/installDeps.sh
# ep_ldapauth from source
# some day we will be able to do it properly with:
# npm install ep_ldapauth
RUN cd /opt/etherpad && \
git clone https://github.com/tykeal/ep_ldapauth.git && \
cd ep_ldapauth && \
npm install && \
cd ../ && \
rm -rf ep_ldapauth
# handle settings
RUN rm /opt/etherpad/settings.json && \
ln -s /opt/etherpad/config/settings.json /opt/etherpad/settings.json
# entrypoint script
COPY start.sh /opt/etherpad/start.sh
RUN chmod ug+x /opt/etherpad/start.sh
# expose, volume
EXPOSE 9001
VOLUME ['/opt/etherpad/config/', '/var/log/etherpad/'] # config
# user, workdir
WORKDIR "/opt/etherpad"
# command
CMD ["/opt/etherpad/start.sh"]