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
|
||||
ADD . /go/src/github.com/special-tactical-service/wiki
|
||||
WORKDIR /go/src/github.com/special-tactical-service/wiki
|
||||
RUN apt-get update && \
|
||||
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
|
||||
COPY . /go/src/github.com/Kugelschieber/marvinblum.de
|
||||
WORKDIR /go/src/github.com/Kugelschieber/marvinblum.de
|
||||
RUN apt-get update && apt-get upgrade -y
|
||||
|
||||
# build backend
|
||||
ENV GOPATH=/go
|
||||
ENV CGO_ENABLED=0
|
||||
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
|
||||
RUN apk update && \
|
||||
apk upgrade && \
|
||||
apk add --no-cache && \
|
||||
apk add ca-certificates && \
|
||||
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
|
||||
|
||||
# default config
|
||||
ENV STS_WIKI_LOGLEVEL=info
|
||||
ENV STS_WIKI_ALLOWED_ORIGINS=*
|
||||
ENV STS_WIKI_HOST=0.0.0.0:80
|
||||
ENV MB_LOGLEVEL=info
|
||||
ENV MB_ALLOWED_ORIGINS=*
|
||||
ENV MB_HOST=0.0.0.0:80
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
@@ -15,7 +15,7 @@ services:
|
||||
- "--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=info@sts.wtf"
|
||||
- "--certificatesresolvers.tls-resolver.acme.email=marvin@marvinblum.de"
|
||||
- "--certificatesresolvers.tls-resolver.acme.storage=/letsencrypt/acme.json"
|
||||
ports:
|
||||
- "80:80"
|
||||
@@ -23,24 +23,20 @@ services:
|
||||
# - "8080:8080"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- /root/stswiki/letsencrypt:/letsencrypt
|
||||
stswiki:
|
||||
image: kugel/stswiki
|
||||
container_name: stswiki
|
||||
- /root/marvinblum/letsencrypt:/letsencrypt
|
||||
marvinblum:
|
||||
image: kugel/marvinblum
|
||||
container_name: marvinblum
|
||||
restart: always
|
||||
depends_on:
|
||||
- traefik
|
||||
environment:
|
||||
- STS_WIKI_CLIENT_ID=VDVCTHBt5AcM4rRLUJR5
|
||||
- STS_WIKI_CLIENT_SECRET=KltFFSoXaZX7wysxIGdzvxW2KpArfar7G9EAzattw3CUgp1Y7UBkRQlnpCGKTwC0
|
||||
- STS_WIKI_ORGANIZATION=sts
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.stswiki.entrypoints=web"
|
||||
- "traefik.http.routers.stswiki.rule=Host(`wiki.sts.wtf`)"
|
||||
- "traefik.http.routers.stswiki.middlewares=http-redirect"
|
||||
- "traefik.http.routers.stswiki-secure.entrypoints=websecure"
|
||||
- "traefik.http.routers.stswiki-secure.rule=Host(`wiki.sts.wtf`)"
|
||||
- "traefik.http.routers.stswiki-secure.tls.certresolver=tls-resolver"
|
||||
- "traefik.http.routers.marvinblum.entrypoints=web"
|
||||
- "traefik.http.routers.marvinblum.rule=Host(`marvinblum.de`)"
|
||||
- "traefik.http.routers.marvinblum.middlewares=http-redirect"
|
||||
- "traefik.http.routers.marvinblum-secure.entrypoints=websecure"
|
||||
- "traefik.http.routers.marvinblum-secure.rule=Host(`marvinblum.de`)"
|
||||
- "traefik.http.routers.marvinblum-secure.tls.certresolver=tls-resolver"
|
||||
- "traefik.http.middlewares.http-redirect.redirectscheme.scheme=https"
|
||||
- "traefik.http.middlewares.http-redirect.redirectscheme.permanent=true"
|
||||
|
||||
Reference in New Issue
Block a user