forked from chaoss/grimoirelab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
78 lines (61 loc) · 2.55 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Copyright (C) 2016-2022 Bitergia
# GPLv3 License
FROM python:3.8-slim-bullseye
LABEL maintainer="Santiago Dueñas <[email protected]>"
ENV DEBIAN_FRONTEND noninteractive
ENV DEPLOY_USER grimoire
ENV DEPLOY_USER_DIR /home/${DEPLOY_USER}
ENV CONF_DIR ${DEPLOY_USER_DIR}/conf
ENV SCRIPTS_DIR ${DEPLOY_USER_DIR}/scripts
ENV GRIMOIRELAB_RELEASE "0.20.2"
# Initial user
RUN useradd ${DEPLOY_USER} --create-home --shell /bin/bash
# install dependencies
RUN apt-get update && \
apt-get -y install --no-install-recommends \
bash locales \
gcc \
git git-core \
python3 \
python3-pip \
python3-venv \
python3-dev \
python3-gdbm \
mariadb-client \
libmariadbclient-dev-compat \
unzip curl wget sudo ssh \
&& \
apt-get clean && \
find /var/lib/apt/lists -type f -delete
RUN echo "${DEPLOY_USER} ALL=NOPASSWD: ALL" >> /etc/sudoers
RUN mkdir -p ${DEPLOY_USER_DIR}/logs ; chown -R ${DEPLOY_USER}:${DEPLOY_USER} ${DEPLOY_USER_DIR}/logs
VOLUME ["/home/bitergia/logs"]
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
#ADD cacert.pem ${DEPLOY_USER_DIR}/cacert.pem
#RUN CERT_PATH=`python3 -m requests.certs` && \
# cat ${DEPLOY_USER_DIR}/cacert.pem >> ${CERT_PATH}
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG C.UTF-8
# Download basic configuration files
ADD https://raw.githubusercontent.com/chaoss/grimoirelab-sirmordred/master/aliases.json ${DEPLOY_USER_DIR}/aliases.json
RUN chmod 444 ${DEPLOY_USER_DIR}/aliases.json
ADD https://raw.githubusercontent.com/chaoss/grimoirelab-sirmordred/master/menu.yaml ${DEPLOY_USER_DIR}/menu.yaml
RUN chmod 444 ${DEPLOY_USER_DIR}/menu.yaml
ADD stage ${DEPLOY_USER_DIR}/stage
RUN chmod 755 ${DEPLOY_USER_DIR}/stage
USER ${DEPLOY_USER}
# Do the deployment for GRIMOIRELAB_RELEASE
WORKDIR ${DEPLOY_USER_DIR}
RUN mkdir -p ${CONF_DIR} && \
git clone -b ${GRIMOIRELAB_RELEASE} --depth 1 https://github.com/grimoirelab/grimoirelab.git && \
cp grimoirelab/requirements.txt ${CONF_DIR}/requirements.txt && \
echo ${GRIMOIRELAB_RELEASE} > ${DEPLOY_USER_DIR}/release && \
echo "Installing and checking GrimoireLab Release"
RUN sudo pip install -r ${CONF_DIR}/requirements.txt
HEALTHCHECK --interval=60s --timeout=6s --retries=1 CMD healthcheck.py -c ${CONF_DIR}/setup.cfg -s 'Exception in Task Manager' || exit 1
CMD ${DEPLOY_USER_DIR}/stage