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 4 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 FROM --platform=amd64 alpine:${ALPINE_VERSION} AS stackedit
ARG STACKEDIT_VERSION ARG STACKEDIT_VERSION
WORKDIR /stackedit WORKDIR /stackedit
RUN apk add -q --progress --update --no-cache git npm python2 RUN apk add -q --progress --update --no-cache git npm
RUN wget -q https://github.com/benweet/stackedit/archive/${STACKEDIT_VERSION}.tar.gz -O stackedit.tar.gz && \ RUN git clone --branch ${STACKEDIT_VERSION} --single-branch --depth 1 https://github.com/benweet/stackedit.git . &> /dev/null
tar -xzf stackedit.tar.gz --strip-components=1 && \ RUN npm install --only=prod
rm stackedit.tar.gz
RUN npm install
RUN npm audit fix RUN npm audit fix
ENV NODE_ENV=production 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 RUN npm run build
FROM scratch AS final FROM scratch AS final

Loading…
Cancel
Save