|
|
@ -6,13 +6,22 @@ WORKDIR /stackedit
|
|
|
|
RUN npm install
|
|
|
|
RUN npm install
|
|
|
|
RUN npm run build
|
|
|
|
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" \
|
|
|
|
LABEL maintainer="quentin.mcgaw@gmail.com" \
|
|
|
|
description="StackEdit server in a lightweight Docker container" \
|
|
|
|
description="StackEdit server in a lightweight Docker container" \
|
|
|
|
download="15.6MB" \
|
|
|
|
size="29.6MB" \
|
|
|
|
size="45.5MB" \
|
|
|
|
|
|
|
|
ram="7MB" \
|
|
|
|
ram="7MB" \
|
|
|
|
cpu_usage="Very low" \
|
|
|
|
cpu_usage="Very low" \
|
|
|
|
github="https://github.com/qdm12/stackedit-docker"
|
|
|
|
github="https://github.com/qdm12/stackedit-docker"
|
|
|
|
COPY --from=stackedit /stackedit/dist /usr/share/nginx/html/
|
|
|
|
EXPOSE 80
|
|
|
|
ENTRYPOINT nginx -g "daemon off;"
|
|
|
|
COPY --from=stackedit /stackedit/dist /
|
|
|
|
|
|
|
|
COPY --from=server /go/src/app/server /server
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/server" ]
|
|
|
|