From ff049925e2bf94c79fb9ee169a821e36997d49fd Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Tue, 5 May 2020 10:23:52 +0200 Subject: [PATCH] Better Docker handling, added sass compiler to Docker image --- Dockerfile | 12 +++++++++--- docker-compose.yml | 3 +-- start.sh | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100755 start.sh diff --git a/Dockerfile b/Dockerfile index b1db1b6..8fe9775 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,18 @@ FROM google/dart:2.7 WORKDIR /app -RUN mkdir /pub-cache +# Get Dart dependencies +RUN mkdir -p /pub-cache ENV PUB_CACHE=/pub-cache ENV PATH="${PATH}:/pub-cache/bin" RUN pub global activate webdev - ADD pubspec.* /app/ RUN pub get -ADD . /app/ RUN pub get --offline + +RUN apt update && apt install ruby-sass ruby-dev build-essential -y +RUN gem install sass-listen + +ADD . /app/ + +CMD ["./start.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 3b2af8f..8ff6606 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,8 +4,7 @@ services: web: build: . ports: - - "8010:8010" - command: webdev serve --release web:8010 --hostname 0.0.0.0 + - "8010:8080" restart: always volumes: - ./web/:/app/web/ diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..c655788 --- /dev/null +++ b/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sass --watch web/style/:web/style -tcompressed & +webdev serve --release --hostname 0.0.0.0