diff --git a/CloudKitty/api/Dockerfile b/CloudKitty/api/Dockerfile new file mode 100644 index 0000000..157b40a --- /dev/null +++ b/CloudKitty/api/Dockerfile @@ -0,0 +1,30 @@ +FROM python:3.7-slim-buster + +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + apache2 \ + libapache2-mod-wsgi-py3 \ + gcc \ + python3-dev \ + && pip install cloudkitty \ + && apt-get purge -y \ + gcc \ + python3-dev \ + && apt-get clean -y \ + && rm -rf /var/cache/apt \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd cloudkitty --create-home --home-dir /home/cloudkitty \ + && mkdir -p /var/www/cloudkitty \ + && cp /usr/local/lib/python3.7/site-packages/cloudkitty/api/app.wsgi /var/www/cloudkitty \ + && chown -R cloudkitty:cloudkitty /var/www/cloudkitty \ + && ln -sf /dev/stdout /var/log/apache2/cloudkitty_error.log \ + && ln -sf /dev/stdout /var/log/apache2/cloudkitty_access.log \ + && ln -sf /dev/stdout /var/log/apache2/error.log \ + && ln -sf /dev/stdout /var/log/apache2/access.log + +COPY apache_cloudkitty.conf /etc/apache2/sites-enabled/cloudkitty.conf + +COPY run_apache.sh /root/run_apache.sh + +CMD ["/root/run_apache.sh"] \ No newline at end of file diff --git a/CloudKitty/api/apache_cloudkitty.conf b/CloudKitty/api/apache_cloudkitty.conf new file mode 100644 index 0000000..b86d36d --- /dev/null +++ b/CloudKitty/api/apache_cloudkitty.conf @@ -0,0 +1,15 @@ +Listen 8889 + + + WSGIDaemonProcess cloudkitty-api processes=2 threads=10 user=cloudkitty display-name=%{GROUP} + WSGIProcessGroup cloudkitty-api + WSGIScriptAlias / /var/www/cloudkitty/app.wsgi + WSGIApplicationGroup %{GLOBAL} + = 2.4> + ErrorLogFormat "%{cu}t %M" + + ErrorLog /var/log/apache2/cloudkitty_error.log + CustomLog /var/log/apache2/cloudkitty_access.log combined + + +WSGISocketPrefix /var/run/apache2 diff --git a/CloudKitty/api/run_apache.sh b/CloudKitty/api/run_apache.sh new file mode 100755 index 0000000..8b75cd7 --- /dev/null +++ b/CloudKitty/api/run_apache.sh @@ -0,0 +1,4 @@ +#!/bin/bash -x + +rm -f "/var/run/apache2/apache2.pid" +exec apache2ctl -DFOREGROUND \ No newline at end of file diff --git a/CloudKitty/processor/Dockerfile b/CloudKitty/processor/Dockerfile new file mode 100644 index 0000000..1344d7e --- /dev/null +++ b/CloudKitty/processor/Dockerfile @@ -0,0 +1,5 @@ +FROM python:3.7-buster + +RUN pip install cloudkitty + +CMD [ "cloudkitty-processor" ] \ No newline at end of file diff --git a/README.md b/README.md index 51982e9..c1b4f60 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # dockerfiles This repository contains the Dockerfiles for Objectif Libre's official images. + +## CloudKitty + +### api + +Contains the Dockerfile for CloudKitty's API and its dependencies. + +### processor + +Contains the Dockerfile for CloudKitty's processor.