Dockerfile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
  2. MAINTAINER Authors name <support@cloudron.io>
  3. RUN mkdir -p /app/code/nginx
  4. WORKDIR /app/code
  5. ENV MATRIXVERSION=v1.8.0
  6. EXPOSE 8000
  7. EXPOSE 3478/udp
  8. # addons wip
  9. # EXPOSE 9000
  10. # nginx
  11. RUN rm /etc/nginx/sites-enabled/*
  12. ADD nginx_matrix.conf /etc/nginx/sites-enabled/
  13. RUN rm -rf /var/lib/nginx && ln -sf /app/data/nginx /var/lib/nginx
  14. RUN rm -rf /var/log/nginx && ln -sf /run/nginx_log /var/log/nginx
  15. # TURN
  16. RUN apt update && apt-get install -y coturn
  17. RUN sed -e 's,#TURNSERVER_ENABLED=1,TURNSERVER_ENABLED=1,' -i /etc/default/coturn && \
  18. rm /etc/turnserver.conf && \
  19. ln -s /app/data/turnserver.conf /etc/turnserver.conf
  20. # Synapse
  21. # a local copy is needed because of the mail templates, else the pip installation would suffice
  22. RUN git clone https://github.com/matrix-org/synapse.git
  23. RUN cd /app/code/synapse && git pull origin master
  24. RUN apt-get install -y build-essential python3-dev libffi-dev \
  25. python3-pip python-setuptools sqlite3 libxml2-dev \
  26. libssl-dev python-virtualenv libjpeg-dev libxslt1-dev libldap2-dev libsasl2-dev && \
  27. rm -rf /var/cache/apt /var/lib/apt/lists
  28. RUN pip3 install --upgrade pip
  29. RUN pip3 install --upgrade setuptools
  30. RUN pip3 install psycopg2-binary python-ldap matrix-synapse-ldap3 lxml netaddr twisted jinja2 bleach bcrypt
  31. RUN pip3 install https://github.com/matrix-org/synapse/archive/${MATRIXVERSION}.tar.gz
  32. # install addons
  33. #RUN cd /app/code && git clone http://github.com/turt2live/matrix-appservice-webhooks
  34. #RUN cd /app/code/matrix-appservice-webhooks && npm install
  35. #RUN mv /app/code/matrix-appservice-webhooks/db /app/code/matrix-appservice-webhooks/db_orig && \
  36. #dir for sqlite db
  37. # ln -sf /app/data/appservice/db /app/code/matrix-appservice-webhooks/db && \
  38. # config
  39. # ln -sf /app/data/appservice/config/config.yaml /app/code/matrix-appservice-webhooks/config/config.yaml && \
  40. # hooks
  41. # ln -sf /app/data/appservice/appservice-registration-webhooks.yaml /app/code/matrix-appservice-webhooks/appservice-registration-webhooks.yaml
  42. # todo:
  43. # to create the config, run the following from /app/code/matrix-appservice-webhooks
  44. # node index.js -r -u "http://localhost:9000" -c config/config.yaml
  45. # add this to homeserver.yml and restart:
  46. # app_service_config_files: ["appservice-registration-webhooks.yaml"]
  47. # to start the appservice use
  48. # node index.js -p 9000 -c config/config.yaml -f appservice-registration-webhooks.yaml
  49. RUN chown -R www-data.www-data /app/code
  50. ADD start_matrix.sh /app/
  51. CMD [ "/app/start_matrix.sh" ]