|
|
|
@ -6,13 +6,22 @@ WORKDIR /stackedit
|
|
|
|
|
RUN npm install
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
FROM nginx:1.15-alpine
|
|
|
|
|
FROM golang:alpine AS server
|
|
|
|
|
RUN apk --update add git build-base upx
|
|
|
|
|
WORKDIR /go/src/app
|
|
|
|
|
COPY main.go ./
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo -o server . && \
|
|
|
|
|
upx -v --best --overlay=strip server && \
|
|
|
|
|
upx -t server
|
|
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
|
LABEL maintainer="quentin.mcgaw@gmail.com" \
|
|
|
|
|
description="StackEdit server in a lightweight Docker container" \
|
|
|
|
|
download="15.6MB" \
|
|
|
|
|
size="45.5MB" \
|
|
|
|
|
size="29.6MB" \
|
|
|
|
|
ram="7MB" \
|
|
|
|
|
cpu_usage="Very low" \
|
|
|
|
|
github="https://github.com/qdm12/stackedit-docker"
|
|
|
|
|
COPY --from=stackedit /stackedit/dist /usr/share/nginx/html/
|
|
|
|
|
ENTRYPOINT nginx -g "daemon off;"
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
COPY --from=stackedit /stackedit/dist /
|
|
|
|
|
COPY --from=server /go/src/app/server /server
|
|
|
|
|
ENTRYPOINT [ "/server" ]
|
|
|
|
|