mirror of
https://github.com/Kugelschieber/schnittfest.git
synced 2026-01-18 10:20:27 +00:00
Added sass build command and updated dockerfile and docker-compose.
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -2,17 +2,17 @@ FROM golang AS build
|
|||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
apt-get install -y curl && \
|
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
|
apt-get install -y nodejs
|
||||||
WORKDIR /go/src/github.com/Kugelschieber/schnittfest
|
WORKDIR /go/src/github.com/Kugelschieber/schnittfest
|
||||||
ADD . .
|
COPY . .
|
||||||
|
|
||||||
# build server
|
# build server
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-s -w" /go/src/github.com/Kugelschieber/schnittfest/main.go && \
|
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
|
mkdir /app && mv /go/src/github.com/Kugelschieber/schnittfest/main /app/server
|
||||||
|
|
||||||
# compile CSS
|
# 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
|
# copy resources
|
||||||
RUN mv /go/src/github.com/Kugelschieber/schnittfest/template /app/template && \
|
RUN mv /go/src/github.com/Kugelschieber/schnittfest/template /app/template && \
|
||||||
@@ -27,12 +27,6 @@ RUN apk update && \
|
|||||||
COPY --from=build /app /app
|
COPY --from=build /app /app
|
||||||
WORKDIR /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
|
# default config
|
||||||
ENV SCHNITTFEST_HOST=0.0.0.0:80
|
ENV SCHNITTFEST_HOST=0.0.0.0:80
|
||||||
ENV SCHNITTFEST_LOGLEVEL=info
|
ENV SCHNITTFEST_LOGLEVEL=info
|
||||||
|
|||||||
@@ -1,7 +1,42 @@
|
|||||||
version: '3'
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
traefik:
|
||||||
|
image: "traefik:v2.2"
|
||||||
|
container_name: traefik
|
||||||
|
restart: always
|
||||||
|
command:
|
||||||
|
# - "--log.level=DEBUG"
|
||||||
|
# - "--api.insecure=true"
|
||||||
|
- "--providers.docker=true"
|
||||||
|
- "--providers.docker.exposedbydefault=false"
|
||||||
|
- "--entrypoints.web.address=:80"
|
||||||
|
- "--entrypoints.websecure.address=:443"
|
||||||
|
- "--certificatesresolvers.tls-resolver.acme.httpchallenge=true"
|
||||||
|
- "--certificatesresolvers.tls-resolver.acme.httpchallenge.entrypoint=web"
|
||||||
|
# - "--certificatesresolvers.tls-resolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
|
||||||
|
- "--certificatesresolvers.tls-resolver.acme.email=contact@schnittfest.gmbh"
|
||||||
|
- "--certificatesresolvers.tls-resolver.acme.storage=/letsencrypt/acme.json"
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
# - "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
- /root/schnittfest/letsencrypt:/letsencrypt
|
||||||
schnittfest:
|
schnittfest:
|
||||||
image: kugel/schnittfest
|
image: kugel/schnittfest
|
||||||
ports:
|
container_name: schnittfest
|
||||||
- "8080:80"
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- traefik
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.schnittfest.entrypoints=web"
|
||||||
|
- "traefik.http.routers.schnittfest.rule=Host(`schnittfest.gmbh`)"
|
||||||
|
- "traefik.http.routers.schnittfest.middlewares=http-redirect"
|
||||||
|
- "traefik.http.routers.schnittfest-secure.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.schnittfest-secure.rule=Host(`schnittfest.gmbh`)"
|
||||||
|
- "traefik.http.routers.schnittfest-secure.tls.certresolver=tls-resolver"
|
||||||
|
- "traefik.http.middlewares.http-redirect.redirectscheme.scheme=https"
|
||||||
|
- "traefik.http.middlewares.http-redirect.redirectscheme.permanent=true"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"description": "Schnittfest GmbH website styling.",
|
"description": "Schnittfest GmbH website styling.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build": "node-sass sass/ -o ../static/ --output-style compressed",
|
||||||
"style": "node-sass -w sass/ -o ../static/ --output-style compressed"
|
"style": "node-sass -w sass/ -o ../static/ --output-style compressed"
|
||||||
},
|
},
|
||||||
"author": "Marvin Blum, Daniel Schramm",
|
"author": "Marvin Blum, Daniel Schramm",
|
||||||
|
|||||||
Reference in New Issue
Block a user