Skip to content

Commit 8a7df4e

Browse files
committed
"Fixing" this python mess graphite-project/graphite-web#2640
1 parent 1d745ae commit 8a7df4e

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

carbon-cache/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
FROM alpine:latest AS build
22

3-
#ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"
3+
ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"
44

55
RUN apk --no-cache add python3 libffi
66

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

99
RUN pip3 install wheel urllib3
1010

11-
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
11+
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
1212

1313

14-
FROM alpine:latest
14+
##FROM alpine:latest
1515

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

18-
RUN apk --no-cache add python3 py3-pip libffi
18+
##RUN apk --no-cache add python3 py3-pip libffi
1919

20-
RUN pip3 install urllib3
20+
##RUN pip3 install urllib3
2121

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

2424
VOLUME /etc/carbon
2525
VOLUME /var/lib/graphite/whisper
2626
EXPOSE 2003
2727

28-
COPY --from=build /opt/graphite /opt/graphite
28+
##COPY --from=build /opt/graphite /opt/graphite
2929

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

graphite-web/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
FROM alpine:latest AS build
22

3-
#ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"
3+
ENV PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/"
44

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

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

99
RUN pip3 install wheel urllib3
1010

1111
# the touch fixes the missing __init__.py file from the broken zope.interface package ...
12-
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.*"
12+
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.*"
1313

1414

15-
FROM alpine:latest
15+
##FROM alpine:latest
1616

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

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

21-
RUN pip3 install urllib3
21+
##RUN pip3 install urllib3
2222

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

2525
COPY wsgi.py /opt/graphite/conf/
2626
#COPY local_settings.py /opt/graphite/lib/graphite/local_settings.py
2727

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

3232
COPY run.sh /run.sh
33-
COPY --from=build /opt/graphite /opt/graphite
33+
##COPY --from=build /opt/graphite /opt/graphite
3434

3535
VOLUME /var/lib/graphite/whisper
3636
EXPOSE 8080

graphite-web/local_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
MIDDLEWARE = ('whitenoise.middleware.WhiteNoiseMiddleware',) + MIDDLEWARE
239239
#STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
240240

241-
STATIC_ROOT = '/opt/graphite/webapp/content/'
241+
#STATIC_ROOT = '/opt/graphite/webapp/content/'
242242

243243

244244

graphite-web/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/sh
22

33

4-
/opt/graphite/bin/django-admin migrate --settings=graphite.settings --run-syncdb
4+
/usr/bin/django-admin migrate --settings=graphite.settings --run-syncdb
55
#/usr/bin/django-admin migrate --settings=graphite.settings --run-syncdb
66

77
cd /opt/graphite/webapp
88
mkdir -p /opt/graphite/lib/content
9-
/opt/graphite/bin/django-admin collectstatic --noinput --settings=graphite.settings
9+
/usr/bin/django-admin collectstatic --noinput --settings=graphite.settings
1010

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

0 commit comments

Comments
 (0)