Bläddra i källkod

Use supervisor

Johannes Zellner 9 år sedan
förälder
incheckning
c4d3b65987
4 ändrade filer med 33 tillägg och 4 borttagningar
  1. 17 0
      CloudronManifest.json
  2. 9 0
      Dockerfile
  3. 1 0
      apache2-app.conf
  4. 6 4
      start.sh

+ 17 - 0
CloudronManifest.json

@@ -17,6 +17,23 @@
     "sendmail": {},
     "ldap": {}
   },
+  "tcpPorts": {
+    "FTP_PORT": {
+      "title": "FTP Port",
+      "description": "FTP control Port",
+      "defaultValue": 29600
+    },
+    "FTP_PORT_PASSV_0": {
+      "title": "FTP PASSV Port 0",
+      "description": "FTP data port 0. Has to be exactly one lower than port 1.",
+      "defaultValue": 29601
+    },
+    "FTP_PORT_PASSV_1": {
+      "title": "FTP PASSV Port 1",
+      "description": "FTP data port 1. Has to be exactly one higher than port 0.",
+      "defaultValue": 29602
+    }
+  },
   "tags": [ "apache", "php", "mysql", "linux" ],
   "developmentMode": false,
   "mediaLinks": [ "https://raw.githubusercontent.com/cloudron-io/lamp-app/master/medialinks/medialink_0.jpg" ],

+ 9 - 0
Dockerfile

@@ -21,8 +21,17 @@ RUN sed -e 's/upload_max_filesize = .*/upload_max_filesize = 8M/' \
 RUN ln -sf /app/data/apache2-app.conf /etc/apache2/sites-available/app.conf
 RUN ln -sf /etc/apache2/sites-available/app.conf /etc/apache2/sites-enabled/app.conf
 
+ENV PATH /usr/local/node-4.2.1/bin:$PATH
+
+RUN cd /app/code && npm install ftpd
+
 ADD apache2-app.conf /app/code/apache2-app.conf
 ADD index.html /app/code/index.html
 ADD start.sh /app/code/start.sh
+ADD ftp.js /app/code/ftp.js
+
+# configure supervisor
+RUN sed -e 's,^logfile=.*$,logfile=/run/app/supervisord.log,' -i /etc/supervisor/supervisord.conf
+ADD supervisor/ /etc/supervisor/conf.d/
 
 CMD [ "/app/code/start.sh" ]

+ 1 - 0
apache2-app.conf

@@ -19,6 +19,7 @@
 
     <Location /webdav>
         DAV on
+        DavDepthInfinity on
         AuthType Basic
         AuthBasicProvider ldap
         AuthName "Cloudron Authorization"

+ 6 - 4
start.sh

@@ -2,7 +2,7 @@
 
 set -eu
 
-mkdir -p /app/data/public
+mkdir -p /app/data/public /run/app /run/apache2
 
 if [ ! -f "/app/data/public/index.html" ]; then
     cp /app/code/index.html /app/data/public/index.html
@@ -17,9 +17,11 @@ sed -e "s@AuthLDAPURL .*@AuthLDAPURL ${LDAP_URL}/${LDAP_USERS_BASE_DN}?username?
     -e "s@AuthLDAPBindPassword .*@AuthLDAPBindPassword ${LDAP_BIND_PASSWORD}@" \
     -i /app/data/apache2-app.conf
 
-chown -R www-data:www-data /app/data /run/app
+chown -R www-data:www-data /app/data /run
 
-echo "Starting apache"
+echo "Cleanup apache pid"
 APACHE_CONFDIR="" source /etc/apache2/envvars
 rm -f "${APACHE_PID_FILE}"
-exec /usr/sbin/apache2 -DFOREGROUND
+
+echo "Starting supervisor"
+exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i lamp