|
|
|
FROM frolvlad/alpine-python2
|
|
|
|
|
|
|
|
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.10/community" >> /etc/apk/repositories
|
|
|
|
|
|
|
|
# install required packages
|
|
|
|
# RUN apk add --no-cache vim curl lsof bind-tools
|
|
|
|
RUN apk add --no-cache "xapian-bindings-python==1.4.11-r2" "xapian-core==1.4.11-r0"
|
|
|
|
|
|
|
|
# add user that will be used to install and run the application
|
|
|
|
RUN addgroup -g 1000 deploy
|
|
|
|
RUN adduser -D -u 1000 -G deploy deploy
|
|
|
|
|
|
|
|
# switch to the created user and install the application
|
|
|
|
USER deploy
|
|
|
|
ENV PATH "$PATH:/home/deploy/.local/bin"
|
|
|
|
ENV MOINMOIN_DATA_BASE_DIR "/data/wikis"
|
|
|
|
|
|
|
|
COPY . /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
RUN pip install --upgrade pip
|
|
|
|
RUN pip install gunicorn
|
|
|
|
RUN pip install wheel
|
|
|
|
|
|
|
|
RUN pip install -r requirements.txt
|
|
|
|
|
|
|
|
# switch back to root to remove header files
|
|
|
|
# USER root
|
|
|
|
# RUN apk del libc-dev libffi-dev openssl-dev python3-dev
|
|
|
|
|
|
|
|
# switch to the created user to run the application
|
|
|
|
USER deploy
|
|
|
|
CMD ["gunicorn", "moin:application", "-b", "0.0.0.0:8000"]
|