Skip to content

Instantly share code, notes, and snippets.

@MohammedEssehemy
Created January 5, 2019 11:59
Show Gist options
  • Save MohammedEssehemy/ce2a19187e1f64a361d452844a95aa90 to your computer and use it in GitHub Desktop.
Save MohammedEssehemy/ce2a19187e1f64a361d452844a95aa90 to your computer and use it in GitHub Desktop.
meteor with unoconv docker file #meteor #unoconv #docker
FROM node:8.12-stretch as build-stage
LABEL maintainer="Mohammed Essehemy <mohammedessehemy@gmail.com>"
ENV METEOR_ALLOW_SUPERUSER=true
WORKDIR /source
ADD ./ /source/
RUN curl https://install.meteor.com/ | sh && \
meteor npm install --production && \
meteor build --server-only --architecture os.linux.x86_64 --directory /build
FROM node:8.12-alpine
LABEL maintainer="Mohammed Essehemy <mohammedessehemy@gmail.com>"
ENV BUILD_PACKAGES="libgcc libstdc++ linux-headers make python gcc g++ git libuv bash curl tar bzip2 build-base"
ENV RUNTIME_PACKAGES="mc util-linux libreoffice-common libreoffice-writer ttf-droid-nonlatin ttf-droid ttf-dejavu ttf-freefont ttf-liberation"
ENV UNO_URL https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv
ENV METEOR_NPM_REBUILD_FLAGS="--update-binary --build-from-source=bcrypt"
COPY --from=build-stage /build /home/node
WORKDIR /home/node/bundle
RUN apk --update --no-cache add --virtual .builds-deps ${BUILD_PACKAGES} && \
# unoconv
apk --no-cache add ${RUNTIME_PACKAGES} && \
curl -Ls $UNO_URL -o /usr/local/bin/unoconv && \
chmod +x /usr/local/bin/unoconv && \
ln -s /usr/bin/python3 /usr/bin/python && \
chmod +x convert.sh && \
chmod +x timer.sh && \
# node_modules
npm install node-gyp -g && \
cd ./programs/server/ && \
npm install --unsafe-perm --production && \
npm audit fix && \
npm cache clean --force && \
apk del .builds-deps && \
rm -rf /var/cache/apk/*
RUN chown node:node -R /home/node/bundle
USER node
CMD node /home/node/bundle/main.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment