Dockerfile 858 Bytes
Newer Older
Luiz Costa's avatar
Luiz Costa committed
1
FROM alpine
Luiz Costa's avatar
Luiz Costa committed
2

Luiz Costa's avatar
Luiz Costa committed
3
LABEL maintainer="luiz@thenets.org"
Luiz Costa's avatar
Luiz Costa committed
4 5

ENV PARSOID_HOME=/var/lib/parsoid \
Luiz Costa's avatar
Luiz Costa committed
6
    PARSOID_USER=parsoid \
Luiz Costa's avatar
Luiz Costa committed
7 8
    # PARSOID_VERSION [v0.8.1, v0.9.0, v0.10.0, v0.11.0, master]
    PARSOID_VERSION=v0.11.0
9

Luiz Costa's avatar
Luiz Costa committed
10
COPY run-parsoid.sh /run-parsoid.sh
Luiz Costa's avatar
Luiz Costa committed
11

Luiz Costa's avatar
Luiz Costa committed
12
# Parsoid setup
Luiz Costa's avatar
Luiz Costa committed
13
RUN set -x \
Luiz Costa's avatar
Luiz Costa committed
14 15
    # Install required packages
    && apk add --no-cache nodejs nodejs-npm python git tar bash make \
Luiz Costa's avatar
Luiz Costa committed
16
    # Add user
Luiz Costa's avatar
Luiz Costa committed
17 18 19
    && adduser -D -u 1000 -s /bin/bash $PARSOID_USER \
    # Set permissions
    && chmod -v +x /run-parsoid.sh \
Luiz Costa's avatar
Luiz Costa committed
20
    # Core
Luiz Costa's avatar
Luiz Costa committed
21
    && mkdir -p $PARSOID_HOME \
Luiz Costa's avatar
Luiz Costa committed
22
    && git clone \
23
        --branch ${PARSOID_VERSION} \
Luiz Costa's avatar
Luiz Costa committed
24 25 26 27 28 29
        --single-branch \
        --depth 1 \
        --quiet \
        https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid \
        $PARSOID_HOME \
    && cd $PARSOID_HOME \
Luiz Costa's avatar
Luiz Costa committed
30
    && npm install
Luiz Costa's avatar
Luiz Costa committed
31 32

EXPOSE 8000
33
EXPOSE 8001
Luiz Costa's avatar
Luiz Costa committed
34

Luiz Costa's avatar
Luiz Costa committed
35
CMD ["/run-parsoid.sh"]