0.0.0.0:80 mx-puppet-mush / master Dockerfile
master

Tree @master (Download .tar.gz)

Dockerfile @masterraw · history · blame

FROM node:alpine AS builder

WORKDIR /opt/mx-puppet-mush

RUN apk --no-cache add git python make g++ pkgconfig \
    build-base \
    cairo-dev \
    jpeg-dev \
    pango-dev \
    musl-dev \
    giflib-dev \
    pixman-dev \
    pangomm-dev \
    libjpeg-turbo-dev \
    freetype-dev

COPY package.json package-lock.json ./
RUN chown -R node:node /opt/mx-puppet-mush

USER node
RUN cat package-lock.json
RUN npm install

COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build


FROM node:alpine

VOLUME /data

ENV CONFIG_PATH=/data/config.yaml \
    REGISTRATION_PATH=/data/mush-registration.yaml

RUN apk add --no-cache su-exec \
    cairo \
    jpeg \
    pango \
    musl \
    giflib \
    pixman \
    pangomm \
    libjpeg-turbo \
    freetype

WORKDIR /opt/mx-puppet-mush
COPY docker-run.sh ./
COPY --from=builder /opt/mx-puppet-mush/node_modules/ ./node_modules/
COPY --from=builder /opt/mx-puppet-mush/build/ ./build/

# change workdir to /data so relative paths in the config.yaml
# point to the persisten volume
WORKDIR /data
ENTRYPOINT ["/opt/mx-puppet-mush/docker-run.sh"]