Dockerfile 1.64 KB
Newer Older
Philippe Pepiot's avatar
Philippe Pepiot committed
1
ARG DIST
2
FROM debian:$DIST-slim as base
Philippe Pepiot's avatar
Philippe Pepiot committed
3
4
5
6
7
8
9
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/*
RUN apt-get update && apt-get -y --no-install-recommends install \
    gettext \
    uwsgi \
10
    uwsgi-plugin-python3 \
Philippe Pepiot's avatar
Philippe Pepiot committed
11
12
    graphviz \
    postgresql-client \
13
14
    python3-pip \
    python3-setuptools \
Philippe Pepiot's avatar
Philippe Pepiot committed
15
16
    pwgen \
    && rm -rf /var/lib/apt/lists/*
17
RUN export py=python3 pip=pip3; \
Philippe Pepiot's avatar
Philippe Pepiot committed
18
    update-alternatives --install /usr/bin/python python /usr/bin/$py 50 && \
19
20
    update-alternatives --install /usr/bin/pip pip /usr/bin/$pip 50 && \
    pip install --upgrade pip
21
22
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
23

Philippe Pepiot's avatar
Philippe Pepiot committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
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
45
46
47
48

ARG CUBICWEB_SOURCE
RUN pip install $CUBICWEB_SOURCE

Philippe Pepiot's avatar
Philippe Pepiot committed
49
50
USER cubicweb
WORKDIR /home/cubicweb
51
52


Philippe Pepiot's avatar
Philippe Pepiot committed
53
54
55
EXPOSE 8080/tcp
ENTRYPOINT ["/entrypoint.sh"]
CMD ["start"]