Sass fix for permissions
This commit is contained in:
parent
d345791fe3
commit
43a98f7164
|
@ -1,10 +1,17 @@
|
||||||
|
#FROM python:3.6-alpine
|
||||||
FROM python:3.6
|
FROM python:3.6
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
|
#RUN apk add --no-cache libev-dev git postgresql-dev gcc python3-dev musl-dev
|
||||||
|
|
||||||
|
#RUN apt update
|
||||||
|
#RUN apt install -y libev-dev libevdev2 git python3-dev
|
||||||
|
|
||||||
# Requirements have to be pulled and installed here, otherwise caching won't work
|
# Requirements have to be pulled and installed here, otherwise caching won't work
|
||||||
COPY ./requirements /requirements
|
COPY ./requirements /requirements
|
||||||
|
|
||||||
|
|
||||||
RUN pip install --cache-dir ./cache/pip -r /requirements/local.txt \
|
RUN pip install --cache-dir ./cache/pip -r /requirements/local.txt \
|
||||||
&& groupadd -r django \
|
&& groupadd -r django \
|
||||||
&& useradd -r -g django django
|
&& useradd -r -g django django
|
||||||
|
@ -20,6 +27,7 @@ RUN mkdir -p /var/log/gunicorn/ \
|
||||||
COPY ./compose/django/dev-gunicorn-mhackspace.sh /dev-gunicorn-mhackspace.sh
|
COPY ./compose/django/dev-gunicorn-mhackspace.sh /dev-gunicorn-mhackspace.sh
|
||||||
COPY ./compose/django/live-gunicorn-mhackspace.sh /live-gunicorn-mhackspace.sh
|
COPY ./compose/django/live-gunicorn-mhackspace.sh /live-gunicorn-mhackspace.sh
|
||||||
COPY ./compose/django/stage-gunicorn-mhackspace.sh /stage-gunicorn-mhackspace.sh
|
COPY ./compose/django/stage-gunicorn-mhackspace.sh /stage-gunicorn-mhackspace.sh
|
||||||
|
COPY ./compose/django/bjoern.py /bjoern.py
|
||||||
COPY ./compose/django/entrypoint.sh /entrypoint.sh
|
COPY ./compose/django/entrypoint.sh /entrypoint.sh
|
||||||
RUN sed -i 's/\r//' /entrypoint.sh \
|
RUN sed -i 's/\r//' /entrypoint.sh \
|
||||||
&& sed -i 's/\r//' /stage-gunicorn-mhackspace.sh \
|
&& sed -i 's/\r//' /stage-gunicorn-mhackspace.sh \
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
"""
|
||||||
|
WSGI config for Maidstone Hackspace project.
|
||||||
|
|
||||||
|
This module contains the WSGI application used by Django's development server
|
||||||
|
and any production WSGI deployments. It should expose a module-level variable
|
||||||
|
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
|
||||||
|
this application via the ``WSGI_APPLICATION`` setting.
|
||||||
|
|
||||||
|
Usually you will have the standard Django WSGI application here, but it also
|
||||||
|
might make sense to replace the whole Django WSGI application with a custom one
|
||||||
|
that later delegates to the Django one. For example, you could introduce WSGI
|
||||||
|
middleware here, or combine a Django application with an application of another
|
||||||
|
framework.
|
||||||
|
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
import bjoern
|
||||||
|
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
|
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
|
||||||
|
# if running multiple sites in the same mod_wsgi process. To fix this, use
|
||||||
|
# mod_wsgi daemon mode with each site in its own daemon process, or use
|
||||||
|
# os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.production"
|
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
|
||||||
|
|
||||||
|
# This application object is used by any WSGI server configured to use this
|
||||||
|
# file. This includes Django's development server, if the WSGI_APPLICATION
|
||||||
|
# setting points here.
|
||||||
|
application = get_wsgi_application()
|
||||||
|
|
||||||
|
# Apply WSGI middleware here.
|
||||||
|
# from helloworld.wsgi import HelloWorldApplication
|
||||||
|
# application = HelloWorldApplication(application)
|
||||||
|
# apply Werkzeug WSGI middleware
|
||||||
|
# if os.environ.setdefault('DJANGO_DEBUG', 'False') is True:
|
||||||
|
from werkzeug.debug import DebuggedApplication
|
||||||
|
# application.wsgi_app = DebuggedApplication(application.wsgi_app, evalex=True)
|
||||||
|
application = DebuggedApplication(application, evalex=True, pin_security=True)
|
||||||
|
application.debug = True
|
||||||
|
|
||||||
|
bjoern.run(application, 'unix:/data/sockets/bjoern-mhackspace.sock')
|
|
@ -2,4 +2,4 @@
|
||||||
#python /app/manage.py collectstatic --noinput
|
#python /app/manage.py collectstatic --noinput
|
||||||
#python /app/manage.py compilescss
|
#python /app/manage.py compilescss
|
||||||
|
|
||||||
/usr/local/bin/gunicorn config.wsgi -w 2 -b unix:/data/sockets/dev-gunicorn-mhackspace.sock --reload --chdir=/app
|
/usr/local/bin/gunicorn config.wsgi -w 1 -b unix:/data/sockets/dev-gunicorn-mhackspace.sock --reload --chdir=/app
|
||||||
|
|
|
@ -446,7 +446,8 @@ PAYMENT_PROVIDERS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
SASS_PRECISION = 8
|
SASS_PRECISION = 8
|
||||||
|
# Important this fixes permission issues by compiling in a temporary folder, instead of inside your project
|
||||||
|
SASS_PROCESSOR_ROOT = os.path.join('/tmp', 'sass')
|
||||||
SASS_PROCESSOR_INCLUDE_DIRS = [
|
SASS_PROCESSOR_INCLUDE_DIRS = [
|
||||||
str(APPS_DIR) + '/static/sass',
|
str(APPS_DIR) + '/static/sass',
|
||||||
str(ROOT_DIR) + '/node_modules',
|
str(ROOT_DIR) + '/node_modules',
|
||||||
|
|
|
@ -17,7 +17,7 @@ from .common import * # noqa
|
||||||
# DEBUG
|
# DEBUG
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
DEBUG = env.bool('DJANGO_DEBUG', default=True)
|
DEBUG = env.bool('DJANGO_DEBUG', default=True)
|
||||||
|
DEBUG = True
|
||||||
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
|
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
|
||||||
|
|
||||||
# SECRET CONFIGURATION
|
# SECRET CONFIGURATION
|
||||||
|
@ -169,7 +169,9 @@ AWS_S3_OBJECT_PARAMETERS = {
|
||||||
AWS_LOCATION = 'dev'
|
AWS_LOCATION = 'dev'
|
||||||
AWS_S3_SECURE_URLS = True
|
AWS_S3_SECURE_URLS = True
|
||||||
STATIC_URL = '%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME)
|
STATIC_URL = '%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME)
|
||||||
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
|
||||||
|
|
||||||
|
STATICFILES_STORAGE = 'mhackspace.core.storage.SassStorageFix'
|
||||||
|
|
||||||
# COMPRESSOR
|
# COMPRESSOR
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -32,6 +32,9 @@ application = get_wsgi_application()
|
||||||
# from helloworld.wsgi import HelloWorldApplication
|
# from helloworld.wsgi import HelloWorldApplication
|
||||||
# application = HelloWorldApplication(application)
|
# application = HelloWorldApplication(application)
|
||||||
# apply Werkzeug WSGI middleware
|
# apply Werkzeug WSGI middleware
|
||||||
if os.environ.setdefault('DEBUG', 'False') is True:
|
# if os.environ.setdefault('DJANGO_DEBUG', 'False') is True:
|
||||||
from werkzeug.debug import DebuggedApplication
|
from werkzeug.debug import DebuggedApplication
|
||||||
application = DebuggedApplication(application, evalex=True)
|
# application.wsgi_app = DebuggedApplication(application.wsgi_app, evalex=True)
|
||||||
|
application = DebuggedApplication(application, evalex=True, pin_security=True)
|
||||||
|
application.debug = True
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
# - redis
|
# - redis
|
||||||
|
# command: python /bjorne.py
|
||||||
command: /dev-gunicorn-mhackspace.sh
|
command: /dev-gunicorn-mhackspace.sh
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -76,4 +77,4 @@ services:
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
- ./mhackspace:/data
|
- ./mhackspace:/data
|
||||||
command: server /data
|
command: server --config-dir /tmp/minio /data
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
from storages.backends.s3boto3 import S3Boto3Storage
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
|
class SassStorageFix(S3Boto3Storage):
|
||||||
|
base_url = settings.AWS_S3_ENDPOINT_URL
|
|
@ -60,6 +60,8 @@ lxml==3.7.3
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
gevent==1.2.2
|
gevent==1.2.2
|
||||||
gunicorn==19.7.1
|
gunicorn==19.7.1
|
||||||
|
#https://github.com/jonashaag/bjoern
|
||||||
|
#bjoern
|
||||||
|
|
||||||
# Your custom requirements go here
|
# Your custom requirements go here
|
||||||
mock==2.0.0
|
mock==2.0.0
|
||||||
|
|
Loading…
Reference in New Issue