Browse Source

docker: update from ruby sass to sassc

master
Annika Backstrom 7 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:
assets:
image: images.abackstrom.com/sass
commands:
- sass --cache-location /tmp assets/css/main.scss:assets/css/main.css
- sassc -t compressed assets/css/main.scss assets/css/main.css

content:
image: images.abackstrom.com/pelican

+ 1
- 1
Dockerfile View File

@@ -1,4 +1,4 @@
FROM alpine:3.7
FROM alpine:3.9

COPY requirements.txt /requirements.txt


+ 3
- 5
Dockerfile.sass View File

@@ -1,7 +1,5 @@
FROM ubuntu:16.04
FROM alpine:3.9

RUN apt-get update && \
apt-get install -y ruby-sass && \
rm -rf /var/lib/apt/lists/*
COPY sassc/* /usr/bin/

CMD [ "sass" ]
RUN apk add --no-cache sassc

+ 1
- 1
docker-compose.yml View File

@@ -13,7 +13,7 @@ services:
working_dir: /css
volumes:
- ./assets/css:/css
command: sass --cache-location /tmp --watch main.scss:main.css
command: sass-watch

nginx:
image: nginx

+ 11
- 0
sassc/sass-rebuild View File

@@ -0,0 +1,11 @@
#!/bin/ash

event="$1"
directory="$2"
file="$3"

# only include .scss file
echo "$file" | grep -qv "\.scss$" && exit

echo "[sassc] $file -> rebuilding main.css"
sassc -t nested -m auto /css/main.scss /css/main.css

+ 6
- 0
sassc/sass-watch View File

@@ -0,0 +1,6 @@
#!/bin/ash

set -x

sassc -t nested -m auto /css/main.scss /css/main.css
/sbin/inotifyd /usr/bin/sass-rebuild /css:w

Loading…
Cancel
Save