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
|
||||
|
||||
Reference in New Issue
Block a user