-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (29 loc) · 1.08 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
FROM alpine:3.9.6
LABEL maintainer="lucebac <[email protected]>"
RUN apk add -U --no-cache curl unzip nodejs nodejs-npm sqlite openssl git python file \
&& adduser -D ctfpad \
&& mkdir /ctfpad && chown ctfpad:ctfpad /ctfpad \
&& chown ctfpad:ctfpad -R /ctfpad
WORKDIR /ctfpad
# setup ctfpad
RUN cd /ctfpad \
&& git clone https://github.com/ENOFLAG/CTFPad ctfpad \
&& cd ctfpad \
&& npm install \
&& chown ctfpad:ctfpad -R /ctfpad
# setup underlying etherpad
RUN cd /ctfpad/ctfpad \
&& git clone https://github.com/ether/etherpad-lite.git etherpad-lite \
&& ./etherpad-lite/bin/installDeps.sh \
&& rm etherpad-lite/settings.json \
&& chown ctfpad:ctfpad -R /ctfpad
# add config files
ADD config.template.json /ctfpad/ctfpad/config.template.json
ADD settings.template.json /ctfpad/ctfpad/etherpad-lite/settings.template.json
WORKDIR /ctfpad/ctfpad
VOLUME ["/data"]
COPY docker-entrypoint.sh /usr/local/bin/
COPY init.sh /usr/local/bin/
ENTRYPOINT ["init.sh", "&&", "docker-entrypoint.sh"]
EXPOSE 4242 4343
CMD ["su", "ctfpad", "-c", "node", "main.js"]