Added sass build command and updated dockerfile and docker-compose.

This commit is contained in:
Marvin Blum
2020-05-24 13:16:54 +02:00
committed by Marvin Blum
parent 506136ee1a
commit 7470e0128f
3 changed files with 42 additions and 12 deletions

View File

@@ -2,17 +2,17 @@ FROM golang AS build
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh && bash nodesource_setup.sh && \
curl -sL https://deb.nodesource.com/setup_13.x -o nodesource_setup.sh && bash nodesource_setup.sh && \
apt-get install -y nodejs
WORKDIR /go/src/github.com/Kugelschieber/schnittfest
ADD . .
COPY . .
# build server
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-s -w" /go/src/github.com/Kugelschieber/schnittfest/main.go && \
mkdir /app && mv /go/src/github.com/Kugelschieber/schnittfest/main /app/server
# compile CSS
RUN cd /go/src/github.com/Kugelschieber/schnittfest/style && bash -c "npm i" && bash -c "npm rebuild node-sass" && bash -c "npm run style"
RUN cd /go/src/github.com/Kugelschieber/schnittfest/style && bash -c "npm i" && bash -c "npm rebuild node-sass" && bash -c "npm run build"
# copy resources
RUN mv /go/src/github.com/Kugelschieber/schnittfest/template /app/template && \
@@ -27,12 +27,6 @@ RUN apk update && \
COPY --from=build /app /app
WORKDIR /app
# use root to bind port 80 and 443
#RUN addgroup -S appuser && \
# adduser -S -G appuser appuser && \
# chown -R appuser:appuser /app
#USER appuser
# default config
ENV SCHNITTFEST_HOST=0.0.0.0:80
ENV SCHNITTFEST_LOGLEVEL=info