Dockerfile 1.87 KB
Newer Older
Philippe Pepiot's avatar
Philippe Pepiot committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
ARG DIST
FROM debian:$DIST-slim
ENV LANG C.UTF-8
RUN mkdir -p /usr/share/man/man1 && mkdir -p /usr/share/man/man7
RUN apt-get update && apt-get -y dist-upgrade \
    && rm -rf /var/lib/apt/lists/*
ARG PYTHON
RUN apt-get update && apt-get -y --no-install-recommends install \
    gettext \
    uwsgi \
    uwsgi-plugin-$PYTHON \
    graphviz \
    postgresql-client \
    $PYTHON-pip \
    $PYTHON-setuptools \
    $PYTHON-crypto \
    $PYTHON-psycopg2 \
    $PYTHON-jinja2 \
    pwgen \
    && rm -rf /var/lib/apt/lists/*
RUN test $PYTHON = "python" && export py=python2 pip=pip2 || export py=python3 pip=pip3; \
    update-alternatives --install /usr/bin/python python /usr/bin/$py 50 && \
    update-alternatives --install /usr/bin/pip pip /usr/bin/$pip 50
24 25
COPY docker-cubicweb-helper check-docker-updates.sh get-cube /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-cubicweb-helper /usr/local/bin/check-docker-updates.sh /usr/local/bin/get-cube
26 27 28
RUN mkdir /repo
RUN echo -n "" | gzip -9c > /repo/Packages.gz
RUN echo "deb [trusted=yes] file:///repo ./" > /etc/apt/sources.list.d/local.list
Philippe Pepiot's avatar
Philippe Pepiot committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
ENV PIP_NO_CACHE_DIR off
ENV PIP_DISABLE_PIP_VERSION_CHECK on
RUN useradd cubicweb --uid 1000 -m -s /bin/bash
RUN install -d -o cubicweb -g cubicweb /etc/cubicweb.d
COPY uwsgi.ini /etc/uwsgi/uwsgi.ini
RUN echo "plugins = http,$PYTHON" >> /etc/uwsgi/uwsgi.ini
COPY pyramid.ini.j2 /
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV CW_CUBES_PATH=/usr/local/share/cubicweb/cubes
ENV CW_INSTANCE=instance
ENV CW_INSTANCES_DIR=/etc/cubicweb.d
ENV CW_INSTANCES_DATA_DIR=/etc/cubicweb.d
ENV CW_LOG_FILE=/dev/stdout
ENV CW_LOG_THRESHOLD=WARNING
ENV CW_DB_HOST=
ENV CW_DB_USER=cubicweb
ENV CW_DB_PASSWORD=
ENV CW_DB_DRIVER=postgres
ENV CW_LOGIN=admin
ENV CW_PASSWORD=admin
ENV CW_BASE_URL=http://localhost:8080
USER cubicweb
WORKDIR /home/cubicweb
EXPOSE 8080/tcp
ENTRYPOINT ["/entrypoint.sh"]
CMD ["start"]