Fix and improve Docker build

- No need for python2
- Using git to clone specific version
- Installing only production Node modules
- Remove trailing debug cat command
master
Quentin McGaw 5 years ago
parent d545fa9433
commit 66ae17527f

@ -18,14 +18,12 @@ RUN go build -ldflags="-s -w" -o app main.go
FROM --platform=amd64 alpine:${ALPINE_VERSION} AS stackedit
ARG STACKEDIT_VERSION
WORKDIR /stackedit
RUN apk add -q --progress --update --no-cache git npm python2
RUN wget -q https://github.com/benweet/stackedit/archive/${STACKEDIT_VERSION}.tar.gz -O stackedit.tar.gz && \
tar -xzf stackedit.tar.gz --strip-components=1 && \
rm stackedit.tar.gz
RUN npm install
RUN apk add -q --progress --update --no-cache git npm
RUN git clone --branch ${STACKEDIT_VERSION} --single-branch --depth 1 https://github.com/benweet/stackedit.git . &> /dev/null
RUN npm install --only=prod
RUN npm audit fix
ENV NODE_ENV=production
RUN sed -i "s/assetsPublicPath: '\/',/assetsPublicPath: '.\/',/g" config/index.js && cat config/index.js
RUN sed -i "s/assetsPublicPath: '\/',/assetsPublicPath: '.\/',/g" config/index.js
RUN npm run build
FROM scratch AS final

Loading…
Cancel
Save