diff --git a/container-app/Dockerfile b/container-app/Dockerfile index e3298eb..353bf9e 100644 --- a/container-app/Dockerfile +++ b/container-app/Dockerfile @@ -24,6 +24,7 @@ RUN apt-get update && apt-get install -y \ # Install SASS RUN gem install sass +RUN gem install compass # Install phantomjs ADD https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 /home/docker/phantomjs.tar.bz2 diff --git a/container-nginx/nginx.conf b/container-nginx/nginx.conf index d933c89..fc1f905 100644 --- a/container-nginx/nginx.conf +++ b/container-nginx/nginx.conf @@ -4,6 +4,25 @@ events {worker_connections 1024;} # the upstream component nginx needs to connect to http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + error_log /var/log/nginx/error.log warn; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + #include /etc/nginx/conf.d/*.conf; + upstream carparker { server parker:8030; #server unix:///carparker/carparker.sock; # for a file socket @@ -31,14 +50,23 @@ http { } location /extras { - alias /carparker/static; # your Django project's static files - amend as required + alias /carparker/static; # your Django project's static files - amend as required } # Finally, send all non-media requests to the Django server. location / { uwsgi_pass carparker; - #include /carparker/container-nginx/uwsgi_params; # the uwsgi_params file you installed include /home/docker/uwsgi_params; # the uwsgi_params file you installed } + + # Setting correct content-type header as nginx fails to do it by default + location ~* \/static\/.*\.css$ { + add_header Content-Type text/css; + } + + # Setting correct content-type header as nginx fails to do it by default + location ~* \/static\/.*\.js$ { + add_header Content-Type application/x-javascript; + } } } diff --git a/parker/settings.default.py b/parker/settings.default.py index 0bece43..20c495b 100644 --- a/parker/settings.default.py +++ b/parker/settings.default.py @@ -11,7 +11,7 @@ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os -BASE_DIR = os.path.dirname(os.path.dirname(__file__)) +BASE_DIR = "/carparker" # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ @@ -47,6 +47,7 @@ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'debug_toolbar.middleware.DebugToolbarMiddleware', ) ROOT_URLCONF = 'parker.urls' diff --git a/static/compiled/styles/main.css b/static/compiled/styles/main.css new file mode 100644 index 0000000..5371c32 --- /dev/null +++ b/static/compiled/styles/main.css @@ -0,0 +1,17 @@ +html, body { + height: 100%; + margin: 0; + padding: 0; } + +#map { + height: 100%; } + +#search-box { + margin: 10px; + padding: 2px; + width: 33%; + min-width: 360px; + max-width: 500px; + background-color: white; } + +/*# sourceMappingURL=main.css.map */ diff --git a/static/compiled/styles/main.css.map b/static/compiled/styles/main.css.map new file mode 100644 index 0000000..bb8cc3f --- /dev/null +++ b/static/compiled/styles/main.css.map @@ -0,0 +1 @@ +{"names": [], "file": "main.css", "version": 3, "sources": ["main.scss"], "mappings": "AAEA,UAAW;EACV,MAAM,EAAE,IAAI;EACZ,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;;AAGX,IAAK;EACJ,MAAM,EAAE,IAAI;;AAGb,WAAY;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,GAAG;EACZ,KAAK,EAAE,GAAG;EACV,SAAS,EAAE,KAAK;EAChB,SAAS,EAAE,KAAK;EAEhB,gBAAgB,EAnBD,KAAK", "sourceRoot": "../../styles"} \ No newline at end of file