Skip to content

Commit 4c617ea

Browse files
author
Leibnitius
committed
add supervisor
1 parent 904c8f6 commit 4c617ea

File tree

3 files changed

+166
-4
lines changed

3 files changed

+166
-4
lines changed

Dockerfile

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,25 @@
22
#
33
# https://github.com/Leibnitius/etherpad-docker
44
#
5-
# Version 0.1
5+
# Version 0.2
66

77
# Use Docker's nodejs, which is based on ubuntu
88
FROM dockerfile/nodejs
99

1010
# Get Etherpad-lite's other dependencies
1111
RUN apt-get update
12-
RUN apt-get install -y gzip git-core curl python libssl-dev pkg-config build-essential
12+
RUN apt-get install -y gzip git-core curl python libssl-dev pkg-config build-essential supervisor
1313

1414
# Grab the latest Git version
15-
RUN git clone git://github.com/ether/etherpad-lite.git
15+
RUN cd /opt
16+
RUN git clone git://github.com/ether/etherpad-lite.git etherpad
17+
18+
# Install node dependencies
19+
RUN /opt/etherpad/bin/installDeps.sh
20+
21+
# Add conf files
22+
ADD settings.json /opt/etherpad/settings.json
23+
ADD supervisor.conf /etc/supervisor/supervisor.conf
1624

1725
EXPOSE 9001
18-
ENTRYPOINT /root/etherpad-lite/bin/run.sh
26+
ENTRYPOINT ["supervisord", "-c", "/etc/supervisor/supervisor.conf", "-n"]

settings.json

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
// Name your instance!
3+
"title": "Etherpad",
4+
5+
// favicon default name
6+
// alternatively, set up a fully specified Url to your own favicon
7+
"favicon": "favicon.ico",
8+
9+
//IP and port which etherpad should bind at
10+
"ip": "0.0.0.0",
11+
"port" : 9001,
12+
13+
// Session Key, used for reconnecting user sessions
14+
// Set this to a secure string at least 10 characters long. Do not share this value.
15+
// change this...
16+
"sessionKey" : "1q2w3e4r5t",
17+
18+
/*
19+
// Node native SSL support
20+
// this is disabled by default
21+
//
22+
// make sure to have the minimum and correct file access permissions set
23+
// so that the Etherpad server can access them
24+
25+
"ssl" : {
26+
"key" : "/path-to-your/epl-server.key",
27+
"cert" : "/path-to-your/epl-server.crt"
28+
},
29+
30+
*/
31+
32+
//The Type of the database. You can choose between dirty, postgres, sqlite and mysql
33+
//You shouldn't use "dirty" for for anything else than testing or development
34+
"dbType" : "dirty",
35+
//the database specific settings
36+
"dbSettings" : {
37+
"filename" : "var/dirty.db"
38+
},
39+
40+
/* An Example of MySQL Configuration
41+
"dbType" : "mysql",
42+
"dbSettings" : {
43+
"user" : "root",
44+
"host" : "localhost",
45+
"password": "",
46+
"database": "store"
47+
},
48+
*/
49+
50+
//the default text of a pad
51+
"defaultPadText" : "Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http:\/\/etherpad.org\n",
52+
53+
/* Users must have a session to access pads. This effectively allows only group pads to be accessed. */
54+
"requireSession" : false,
55+
56+
/* Users may edit pads but not create new ones. Pad creation is only via the API. This applies both to group pads and regular pads. */
57+
"editOnly" : false,
58+
59+
/* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly,
60+
but makes it impossible to debug the javascript/css */
61+
"minify" : true,
62+
63+
/* How long may clients use served javascript code (in seconds)? Without versioning this
64+
may cause problems during deployment. Set to 0 to disable caching */
65+
"maxAge" : 21600, // 60 * 60 * 6 = 6 hours
66+
67+
/* This is the path to the Abiword executable. Setting it to null, disables abiword.
68+
Abiword is needed to advanced import/export features of pads*/
69+
"abiword" : null,
70+
71+
/* This setting is used if you require authentication of all users.
72+
Note: /admin always requires authentication. */
73+
"requireAuthentication": false,
74+
75+
/* Require authorization by a module, or a user with is_admin set, see below. */
76+
"requireAuthorization": false,
77+
78+
/* Users for basic authentication. is_admin = true gives access to /admin.
79+
If you do not uncomment this, /admin will not be available! */
80+
"users": {
81+
"admin": {
82+
"password": "etherpad",
83+
"is_admin": true
84+
}
85+
},
86+
87+
// restrict socket.io transport methods
88+
"socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"],
89+
90+
/* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */
91+
"loglevel": "INFO",
92+
93+
//Logging configuration. See log4js documentation for further information
94+
// https://github.com/nomiddlename/log4js-node
95+
// You can add as many appenders as you want here:
96+
"logconfig" :
97+
{ "appenders": [
98+
{ "type": "console"
99+
//, "category": "access"// only logs pad access
100+
}
101+
/*
102+
, { "type": "file"
103+
, "filename": "your-log-file-here.log"
104+
, "maxLogSize": 1024
105+
, "backups": 3 // how many log files there're gonna be at max
106+
//, "category": "test" // only log a specific category
107+
}*/
108+
/*
109+
, { "type": "logLevelFilter"
110+
, "level": "warn" // filters out all log messages that have a lower level than "error"
111+
, "appender":
112+
{ Use whatever appender you want here }
113+
}*/
114+
/*
115+
, { "type": "logLevelFilter"
116+
, "level": "error" // filters out all log messages that have a lower level than "error"
117+
, "appender":
118+
{ "type": "smtp"
119+
, "subject": "An error occured in your EPL instance!"
120+
121+
, "sendInterval": 60*5 // in secs -- will buffer log messages; set to 0 to send a mail for every message
122+
, "transport": "SMTP", "SMTP": { // see https://github.com/andris9/Nodemailer#possible-transport-methods
123+
"host": "smtp.example.com", "port": 465,
124+
"secureConnection": true,
125+
"auth": {
126+
"user": "[email protected]",
127+
"pass": "bar_foo"
128+
}
129+
}
130+
}
131+
}*/
132+
] }
133+
}
134+

supervisor.conf

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
[unix_http_server]
5+
file=/var/run//supervisor.sock
6+
chmod=0700
7+
8+
[rpcinterface:supervisor]
9+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
10+
11+
[supervisorctl]
12+
serverurl=unix:///var/run//supervisor.sock
13+
14+
[program:etherpad]
15+
directory=/opt/etherpad
16+
command=node node_modules/ep_etherpad-lite/node/server.js
17+
user=root
18+
autostart=true
19+
autorestart=true
20+

0 commit comments

Comments
 (0)