Skip to content

Commit

Permalink
"Fixing" this python mess graphite-project/graphite-web#2640
Browse files Browse the repository at this point in the history
  • Loading branch information
nook24 committed Apr 20, 2021
1 parent 1d745ae commit 8a7df4e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
14 changes: 7 additions & 7 deletions carbon-cache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
FROM alpine:latest AS build

#ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"
ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"

RUN apk --no-cache add python3 libffi

RUN apk --no-cache add python3-dev gcc libc-dev py3-pip libffi-dev

RUN pip3 install wheel urllib3

RUN pip3 install --no-binary=:all: --prefix=/opt/graphite https://github.com/graphite-project/whisper/tarball/master https://github.com/graphite-project/carbon/tarball/master https://github.com/graphite-project/graphite-web/tarball/master
RUN pip3 install --no-binary=:all: https://github.com/graphite-project/whisper/tarball/master https://github.com/graphite-project/carbon/tarball/master https://github.com/graphite-project/graphite-web/tarball/master


FROM alpine:latest
##FROM alpine:latest

ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/lib/python3.8/site-packages/:/opt/graphite/webapp/"
ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"

RUN apk --no-cache add python3 py3-pip libffi
##RUN apk --no-cache add python3 py3-pip libffi

RUN pip3 install urllib3
##RUN pip3 install urllib3

RUN mkdir -p /etc/carbon /var/lib/graphite/whisper

VOLUME /etc/carbon
VOLUME /var/lib/graphite/whisper
EXPOSE 2003

COPY --from=build /opt/graphite /opt/graphite
##COPY --from=build /opt/graphite /opt/graphite

CMD ["/opt/graphite/bin/carbon-cache.py", "--config=/etc/carbon/carbon.conf", "--nodaemon", "start"]

Expand Down
20 changes: 10 additions & 10 deletions graphite-web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
FROM alpine:latest AS build

#ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"
ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"

RUN apk --no-cache add python3 libffi py3-gunicorn cairo py3-setuptools

RUN apk --no-cache add python3-dev gcc libc-dev py3-pip libffi-dev py3-gunicorn cairo py3-mysqlclient
RUN apk --no-cache add python3-dev gcc libc-dev py3-pip libffi-dev py3-gunicorn cairo py3-mysqlclient py3-setuptools

RUN pip3 install wheel urllib3

# the touch fixes the missing __init__.py file from the broken zope.interface package ...
RUN pip3 install --no-binary=:all: --prefix=/opt/graphite https://github.com/graphite-project/whisper/archive/1.1.6.zip https://github.com/graphite-project/carbon/archive/1.1.6.zip https://github.com/graphite-project/graphite-web/archive/1.1.6.zip "whitenoise==3.*"
RUN pip3 install --no-binary=:all: https://github.com/graphite-project/whisper/archive/1.1.6.zip https://github.com/graphite-project/carbon/archive/1.1.6.zip https://github.com/graphite-project/graphite-web/archive/1.1.6.zip "whitenoise==3.*"


FROM alpine:latest
##FROM alpine:latest

ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/lib/python3.8/site-packages/:/opt/graphite/webapp/"
##ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"

RUN apk --no-cache add python3 libffi py3-gunicorn cairo py3-setuptools py3-mysqlclient py3-pip
##RUN apk --no-cache add python3 libffi py3-gunicorn cairo py3-setuptools py3-mysqlclient py3-pip

RUN pip3 install urllib3
##RUN pip3 install urllib3

RUN mkdir -p /var/lib/graphite/whisper /etc/uwsgi /opt/graphite/webapp/graphite

COPY wsgi.py /opt/graphite/conf/
#COPY local_settings.py /opt/graphite/lib/graphite/local_settings.py

# Link generated config
RUN mkdir -p /opt/graphite/lib/graphite
RUN ln -sf /etc/carbon/local_settings.py /opt/graphite/lib/graphite/local_settings.py
RUN mkdir -p /opt/graphite/webapp/graphite/
RUN ln -sf /etc/carbon/local_settings.py /opt/graphite/webapp/graphite/local_settings.py

COPY run.sh /run.sh
COPY --from=build /opt/graphite /opt/graphite
##COPY --from=build /opt/graphite /opt/graphite

VOLUME /var/lib/graphite/whisper
EXPOSE 8080
Expand Down
2 changes: 1 addition & 1 deletion graphite-web/local_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
MIDDLEWARE = ('whitenoise.middleware.WhiteNoiseMiddleware',) + MIDDLEWARE
#STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

STATIC_ROOT = '/opt/graphite/webapp/content/'
#STATIC_ROOT = '/opt/graphite/webapp/content/'



4 changes: 2 additions & 2 deletions graphite-web/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh


/opt/graphite/bin/django-admin migrate --settings=graphite.settings --run-syncdb
/usr/bin/django-admin migrate --settings=graphite.settings --run-syncdb
#/usr/bin/django-admin migrate --settings=graphite.settings --run-syncdb

cd /opt/graphite/webapp
mkdir -p /opt/graphite/lib/content
/opt/graphite/bin/django-admin collectstatic --noinput --settings=graphite.settings
/usr/bin/django-admin collectstatic --noinput --settings=graphite.settings

cd /opt/graphite/conf
exec /usr/bin/gunicorn -w 4 -b 0.0.0.0:8080 wsgi:application
Expand Down

0 comments on commit 8a7df4e

Please sign in to comment.