- Update to Stackedit 5.13.2 - Update to Alpine 3.8 - Multi stage build using Caddy server - Image cut down to 52MB - Readme simplifiedpull/4/head
parent
98761959f6
commit
a334076b6a
@ -1,20 +1,31 @@
|
||||
FROM alpine:3.7
|
||||
FROM golang:alpine AS caddy
|
||||
WORKDIR /go/src/github.com/mholt/caddy
|
||||
RUN echo https://alpine.global.ssl.fastly.net/alpine/v3.8/main > /etc/apk/repositories && \
|
||||
apk add --progress --update git gcc musl-dev ca-certificates
|
||||
RUN git clone --branch v0.11.0 --single-branch --depth 1 https://github.com/mholt/caddy /go/src/github.com/mholt/caddy &> /dev/null && \
|
||||
sed -i 's/var EnableTelemetry = true/var EnableTelemetry = false/' /go/src/github.com/mholt/caddy/caddy/caddymain/run.go && \
|
||||
sed -i 's/const enableTelemetry = true/const enableTelemetry = false/' /go/src/github.com/mholt/caddy/caddy/caddymain/run.go
|
||||
RUN git clone https://github.com/caddyserver/builds /go/src/github.com/caddyserver/builds
|
||||
RUN cd caddy && go run build.go -goos=linux -goarch=amd64
|
||||
|
||||
FROM alpine:3.8 AS stackedit
|
||||
RUN echo https://alpine.global.ssl.fastly.net/alpine/v3.8/main > /etc/apk/repositories && \
|
||||
apk add -q --progress --update --no-cache git npm
|
||||
RUN git clone --branch v5.13.2 --single-branch --depth 1 https://github.com/benweet/stackedit.git /stackedit &> /dev/null
|
||||
WORKDIR /stackedit
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
FROM alpine:3.8
|
||||
LABEL maintainer="quentin.mcgaw@gmail.com" \
|
||||
description="Run the latest StackEdit server in a Docker container" \
|
||||
download="179MB" \
|
||||
size="581MB" \
|
||||
ram="340MB-500MB" \
|
||||
description="StackEdit server in a lightweight Docker container" \
|
||||
download="???MB" \
|
||||
size="51.2MB" \
|
||||
ram="2MB-3MB" \
|
||||
cpu_usage="Very low" \
|
||||
github="https://github.com/qdm12/stackedit-docker"
|
||||
RUN apk add -q --progress --update --no-cache git nodejs && \
|
||||
git clone https://github.com/benweet/stackedit.git && \
|
||||
cd stackedit && \
|
||||
rm -rf .git .dockerignore .gitignore .travis.yml CHANGELOG.md \
|
||||
Dockerfile LICENSE README.md && \
|
||||
npm --silent install && \
|
||||
npm --silent run build && \
|
||||
apk del -q --progress --purge git && \
|
||||
rm -rf /var/cache/apk/*
|
||||
EXPOSE 8080
|
||||
WORKDIR /stackedit
|
||||
ENTRYPOINT npm start
|
||||
EXPOSE 80
|
||||
COPY --from=caddy /go/src/github.com/mholt/caddy/caddy/caddy /usr/bin/caddy
|
||||
COPY Caddyfile /Caddyfile
|
||||
COPY --from=stackedit /stackedit/dist /stackedit
|
||||
ENTRYPOINT caddy -conf /Caddyfile -log stdout
|
||||
|
@ -1,9 +1,9 @@
|
||||
version: '3'
|
||||
services:
|
||||
stackedit:
|
||||
image: qmcgaw/stackedit
|
||||
container_name: stackedit
|
||||
ports:
|
||||
- "8080:8080/tcp"
|
||||
network_mode: bridge
|
||||
restart: always
|
||||
stackedit:
|
||||
image: qmcgaw/stackedit
|
||||
container_name: stackedit
|
||||
ports:
|
||||
- 8000:80/tcp
|
||||
network_mode: bridge
|
||||
restart: always
|
||||
|
Loading…
Reference in new issue