mirror of
https://github.com/Kugelschieber/marvinblum.git
synced 2026-01-18 06:40:27 +00:00
Implemented docker and docker-compose.
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -1,33 +1,25 @@
|
|||||||
FROM golang AS build
|
FROM golang AS build
|
||||||
ADD . /go/src/github.com/special-tactical-service/wiki
|
COPY . /go/src/github.com/Kugelschieber/marvinblum.de
|
||||||
WORKDIR /go/src/github.com/special-tactical-service/wiki
|
WORKDIR /go/src/github.com/Kugelschieber/marvinblum.de
|
||||||
RUN apt-get update && \
|
RUN apt-get update && apt-get upgrade -y
|
||||||
apt-get upgrade -y && \
|
|
||||||
apt-get install -y curl && \
|
|
||||||
curl -sL https://deb.nodesource.com/setup_13.x -o nodesource_setup.sh && bash nodesource_setup.sh && \
|
|
||||||
apt-get install -y nodejs
|
|
||||||
|
|
||||||
# build backend
|
|
||||||
ENV GOPATH=/go
|
ENV GOPATH=/go
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
RUN go build -ldflags "-s -w" main.go
|
RUN go build -ldflags "-s -w" main.go
|
||||||
|
|
||||||
# build frontend
|
|
||||||
RUN cd /go/src/github.com/special-tactical-service/wiki/public && npm i && npm rebuild node-sass && npm run build
|
|
||||||
|
|
||||||
FROM alpine
|
FROM alpine
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk upgrade && \
|
apk upgrade && \
|
||||||
apk add --no-cache && \
|
apk add --no-cache && \
|
||||||
apk add ca-certificates && \
|
apk add ca-certificates && \
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
COPY --from=build /go/src/github.com/special-tactical-service/wiki /app
|
COPY --from=build /go/src/github.com/Kugelschieber/marvinblum.de /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# default config
|
# default config
|
||||||
ENV STS_WIKI_LOGLEVEL=info
|
ENV MB_LOGLEVEL=info
|
||||||
ENV STS_WIKI_ALLOWED_ORIGINS=*
|
ENV MB_ALLOWED_ORIGINS=*
|
||||||
ENV STS_WIKI_HOST=0.0.0.0:80
|
ENV MB_HOST=0.0.0.0:80
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 443
|
EXPOSE 443
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ services:
|
|||||||
- "--certificatesresolvers.tls-resolver.acme.httpchallenge=true"
|
- "--certificatesresolvers.tls-resolver.acme.httpchallenge=true"
|
||||||
- "--certificatesresolvers.tls-resolver.acme.httpchallenge.entrypoint=web"
|
- "--certificatesresolvers.tls-resolver.acme.httpchallenge.entrypoint=web"
|
||||||
# - "--certificatesresolvers.tls-resolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
|
# - "--certificatesresolvers.tls-resolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
|
||||||
- "--certificatesresolvers.tls-resolver.acme.email=info@sts.wtf"
|
- "--certificatesresolvers.tls-resolver.acme.email=marvin@marvinblum.de"
|
||||||
- "--certificatesresolvers.tls-resolver.acme.storage=/letsencrypt/acme.json"
|
- "--certificatesresolvers.tls-resolver.acme.storage=/letsencrypt/acme.json"
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
@@ -23,24 +23,20 @@ services:
|
|||||||
# - "8080:8080"
|
# - "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
- /root/stswiki/letsencrypt:/letsencrypt
|
- /root/marvinblum/letsencrypt:/letsencrypt
|
||||||
stswiki:
|
marvinblum:
|
||||||
image: kugel/stswiki
|
image: kugel/marvinblum
|
||||||
container_name: stswiki
|
container_name: marvinblum
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- traefik
|
- traefik
|
||||||
environment:
|
|
||||||
- STS_WIKI_CLIENT_ID=VDVCTHBt5AcM4rRLUJR5
|
|
||||||
- STS_WIKI_CLIENT_SECRET=KltFFSoXaZX7wysxIGdzvxW2KpArfar7G9EAzattw3CUgp1Y7UBkRQlnpCGKTwC0
|
|
||||||
- STS_WIKI_ORGANIZATION=sts
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.stswiki.entrypoints=web"
|
- "traefik.http.routers.marvinblum.entrypoints=web"
|
||||||
- "traefik.http.routers.stswiki.rule=Host(`wiki.sts.wtf`)"
|
- "traefik.http.routers.marvinblum.rule=Host(`marvinblum.de`)"
|
||||||
- "traefik.http.routers.stswiki.middlewares=http-redirect"
|
- "traefik.http.routers.marvinblum.middlewares=http-redirect"
|
||||||
- "traefik.http.routers.stswiki-secure.entrypoints=websecure"
|
- "traefik.http.routers.marvinblum-secure.entrypoints=websecure"
|
||||||
- "traefik.http.routers.stswiki-secure.rule=Host(`wiki.sts.wtf`)"
|
- "traefik.http.routers.marvinblum-secure.rule=Host(`marvinblum.de`)"
|
||||||
- "traefik.http.routers.stswiki-secure.tls.certresolver=tls-resolver"
|
- "traefik.http.routers.marvinblum-secure.tls.certresolver=tls-resolver"
|
||||||
- "traefik.http.middlewares.http-redirect.redirectscheme.scheme=https"
|
- "traefik.http.middlewares.http-redirect.redirectscheme.scheme=https"
|
||||||
- "traefik.http.middlewares.http-redirect.redirectscheme.permanent=true"
|
- "traefik.http.middlewares.http-redirect.redirectscheme.permanent=true"
|
||||||
|
|||||||
Reference in New Issue
Block a user