Browse Source

docker: update from ruby sass to sassc

master
Annika Backstrom 3 months ago
parent
commit
318fa55793
Signed by: Annika Backstrom <annika@sixohthree.com> GPG Key ID: 1FB1723D467863F4
6 changed files with 23 additions and 8 deletions
  1. 1
    1
      .drone.yml
  2. 1
    1
      Dockerfile
  3. 3
    5
      Dockerfile.sass
  4. 1
    1
      docker-compose.yml
  5. 11
    0
      sassc/sass-rebuild
  6. 6
    0
      sassc/sass-watch

+ 1
- 1
.drone.yml View File

@@ -2,7 +2,7 @@ pipeline:
2 2
   assets:
3 3
     image: images.abackstrom.com/sass
4 4
     commands:
5
-      - sass --cache-location /tmp assets/css/main.scss:assets/css/main.css
5
+      - sassc -t compressed assets/css/main.scss assets/css/main.css
6 6
 
7 7
   content:
8 8
     image: images.abackstrom.com/pelican

+ 1
- 1
Dockerfile View File

@@ -1,4 +1,4 @@
1
-FROM alpine:3.7
1
+FROM alpine:3.9
2 2
 
3 3
 COPY requirements.txt /requirements.txt
4 4
 

+ 3
- 5
Dockerfile.sass View File

@@ -1,7 +1,5 @@
1
-FROM ubuntu:16.04
1
+FROM alpine:3.9
2 2
 
3
-RUN apt-get update && \
4
-  apt-get install -y ruby-sass && \
5
-  rm -rf /var/lib/apt/lists/*
3
+COPY sassc/* /usr/bin/
6 4
 
7
-CMD [ "sass" ]
5
+RUN apk add --no-cache sassc

+ 1
- 1
docker-compose.yml View File

@@ -13,7 +13,7 @@ services:
13 13
     working_dir: /css
14 14
     volumes:
15 15
       - ./assets/css:/css
16
-    command: sass --cache-location /tmp --watch main.scss:main.css
16
+    command: sass-watch
17 17
 
18 18
   nginx:
19 19
     image: nginx

+ 11
- 0
sassc/sass-rebuild View File

@@ -0,0 +1,11 @@
1
+#!/bin/ash
2
+
3
+event="$1"
4
+directory="$2"
5
+file="$3"
6
+
7
+# only include .scss file
8
+echo "$file" | grep -qv "\.scss$" && exit
9
+
10
+echo "[sassc] $file -> rebuilding main.css"
11
+sassc -t nested -m auto /css/main.scss /css/main.css

+ 6
- 0
sassc/sass-watch View File

@@ -0,0 +1,6 @@
1
+#!/bin/ash
2
+
3
+set -x
4
+
5
+sassc -t nested -m auto /css/main.scss /css/main.css
6
+/sbin/inotifyd /usr/bin/sass-rebuild /css:w

Loading…
Cancel
Save