mirror of
https://github.com/Kugelschieber/schnittfest.git
synced 2026-01-18 10:20:27 +00:00
Added sass build and Dockerfile.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
.idea/
|
.idea/
|
||||||
|
style/node_modules/
|
||||||
|
|||||||
45
Dockerfile
Normal file
45
Dockerfile
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
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 && \
|
||||||
|
apt-get install -y nodejs
|
||||||
|
WORKDIR /go/src/github.com/Kugelschieber/schnittfest
|
||||||
|
ADD . .
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
|
||||||
|
# copy resources
|
||||||
|
RUN mv /go/src/github.com/Kugelschieber/schnittfest/template /app/template && \
|
||||||
|
mv /go/src/github.com/Kugelschieber/schnittfest/static /app/static
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
RUN apk update && \
|
||||||
|
apk upgrade && \
|
||||||
|
apk add --no-cache && \
|
||||||
|
apk add ca-certificates && \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
COPY --from=build /app /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN addgroup -S appuser && \
|
||||||
|
adduser -S -G appuser appuser && \
|
||||||
|
chown -R appuser:appuser /app
|
||||||
|
USER appuser
|
||||||
|
|
||||||
|
# default config
|
||||||
|
ENV EMVI_WIKI_HOST=0.0.0.0:8080
|
||||||
|
ENV EMVI_WIKI_LOGLEVEL=info
|
||||||
|
ENV EMVI_WIKI_ALLOWED_ORIGINS=*
|
||||||
|
ENV EMVI_WIKI_HTTP_WRITE_TIMEOUT=5
|
||||||
|
ENV EMVI_WIKI_HTTP_READ_TIMEOUT=5
|
||||||
|
ENV EMVI_WIKI_TEMPLATE_BASE=/template
|
||||||
|
|
||||||
|
# run
|
||||||
|
EXPOSE 8080
|
||||||
|
ENTRYPOINT ["/app/server"]
|
||||||
1
static/main.css
Normal file
1
static/main.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
html,body{font-family:sans-serif}
|
||||||
1467
style/package-lock.json
generated
Normal file
1467
style/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
style/package.json
Normal file
14
style/package.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "schnittfest",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Schnittfest GmbH website styling.",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"style": "node-sass sass/ -o ../static/ --output-style compressed"
|
||||||
|
},
|
||||||
|
"author": "Marvin Blum, Daniel Schramm",
|
||||||
|
"license": "ISC",
|
||||||
|
"devDependencies": {
|
||||||
|
"node-sass": "^4.13.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
3
style/sass/main.scss
Normal file
3
style/sass/main.scss
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
html, body {
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user