File docker/Dockerfile-postgresql.tmpl changed (mode: 100644) (index 4c0ebb5..14795a5) |
1 |
|
FROM fedora:32 |
|
|
1 |
|
FROM postgres:latest |
2 |
2 |
MAINTAINER Catalin(ux) M. BOIE <catab-docker@embedromix.ro> |
MAINTAINER Catalin(ux) M. BOIE <catab-docker@embedromix.ro> |
3 |
3 |
|
|
4 |
|
EXPOSE 5432 |
|
5 |
|
|
|
6 |
|
USER root |
|
7 |
|
RUN dnf -y --setopt=tsflags=nodocs install postgresql-server psmisc procps-ng glibc-langpack-en |
|
8 |
|
|
|
9 |
|
# Force cache cleaning |
|
10 |
|
RUN echo @@RP_VER@@ |
|
11 |
|
|
|
12 |
|
RUN dnf -y --setopt=tsflags=nodocs upgrade --best --allowerasing |
|
13 |
|
|
|
14 |
|
USER postgres |
|
15 |
4 |
ENV LC_ALL en_US.UTF-8 |
ENV LC_ALL en_US.UTF-8 |
16 |
5 |
ENV LC_CTYPE en_US.UTF-8 |
ENV LC_CTYPE en_US.UTF-8 |
17 |
|
ENV PGDATA /var/lib/pgsql/data |
|
18 |
6 |
|
|
19 |
|
RUN ls -l /var/lib/pgsql/data |
|
20 |
|
RUN initdb --data-checksums |
|
21 |
|
|
|
22 |
|
RUN pg_ctl start -w --timeout 60 \ |
|
23 |
|
&& psql --command "CREATE USER rocketgit WITH PASSWORD 'rock'" \ |
|
24 |
|
&& createdb -O rocketgit rocketgit |
|
25 |
|
|
|
26 |
|
RUN echo "host all all 0.0.0.0/0 trust" >> /var/lib/pgsql/data/pg_hba.conf |
|
27 |
|
RUN echo "listen_addresses='*'" >> /var/lib/pgsql/data/postgresql.conf |
|
28 |
|
|
|
29 |
|
VOLUME /var/lib/pgsql |
|
|
7 |
|
# Force cache cleaning |
|
8 |
|
RUN echo @@RP_VER@@ |
30 |
9 |
|
|
31 |
|
CMD ["/usr/bin/postgres"] |
|
|
10 |
|
#RUN dnf -y --setopt=tsflags=nodocs upgrade --best --allowerasing |
|
11 |
|
RUN apt update && apt -y upgrade |
32 |
12 |
|
|
File docker/Dockerfile-rocketgit-dev.tmpl copied from file docker/Dockerfile-rocketgit.tmpl (similarity 78%) (mode: 100644) (index c0a8c09..cfe2f2b) |
1 |
|
FROM fedora:32 |
|
|
1 |
|
FROM fedora:latest |
2 |
2 |
MAINTAINER Catalin(ux) M. BOIE <catab-docker@embedromix.ro> |
MAINTAINER Catalin(ux) M. BOIE <catab-docker@embedromix.ro> |
3 |
3 |
|
|
4 |
4 |
EXPOSE 80 |
EXPOSE 80 |
|
... |
... |
EXPOSE 443 |
6 |
6 |
EXPOSE 22 |
EXPOSE 22 |
7 |
7 |
EXPOSE 9418 |
EXPOSE 9418 |
8 |
8 |
|
|
9 |
|
COPY rg.sh / |
|
10 |
|
|
|
11 |
|
CMD ["/rg.sh"] |
|
12 |
|
|
|
13 |
9 |
RUN dnf -y --setopt=tsflags=nodocs upgrade --best --allowerasing; echo @@VER@@ |
RUN dnf -y --setopt=tsflags=nodocs upgrade --best --allowerasing; echo @@VER@@ |
14 |
|
RUN dnf -y --setopt=tsflags=nodocs install \ |
|
15 |
|
http://kernel.embedromix.ro/dinorepo-0.0.12-1.noarch.rpm |
|
16 |
10 |
|
|
17 |
11 |
RUN dnf -y --setopt=tsflags=nodocs install psmisc procps-ng sendmail \ |
RUN dnf -y --setopt=tsflags=nodocs install psmisc procps-ng sendmail \ |
18 |
|
php-opcache qrencode openssh-server nginx rocketgit |
|
19 |
|
|
|
20 |
|
RUN dnf -y clean all |
|
|
12 |
|
php-opcache qrencode openssh-server nginx \ |
|
13 |
|
php-fpm php-cli php-pgsql php-mbstring git-core \ |
|
14 |
|
php-json php-ldap util-linux fuse strace gpg mc |
21 |
15 |
|
|
22 |
16 |
RUN sed -i -e 's|;opcache.enable_cli=.*|opcache.enable_cli=1|' \ |
RUN sed -i -e 's|;opcache.enable_cli=.*|opcache.enable_cli=1|' \ |
23 |
17 |
/etc/php.d/10-opcache.ini |
/etc/php.d/10-opcache.ini |
|
... |
... |
RUN sed -i -e 's|;opcache.enable_cli=.*|opcache.enable_cli=1|' \ |
26 |
20 |
RUN grep -q ^rocketgit ${dir}/etc/mail/trusted-users \ |
RUN grep -q ^rocketgit ${dir}/etc/mail/trusted-users \ |
27 |
21 |
|| echo "rocketgit" >> /etc/mail/trusted-users |
|| echo "rocketgit" >> /etc/mail/trusted-users |
28 |
22 |
|
|
|
23 |
|
CMD ["/rg.sh"] |
|
24 |
|
|
|
25 |
|
RUN useradd rocketgit |
|
26 |
|
|
|
27 |
|
COPY rg.sh / |
|
28 |
|
|
29 |
29 |
# Pay attention! Volumes comes after we populate the folders! |
# Pay attention! Volumes comes after we populate the folders! |
30 |
30 |
VOLUME /var/lib/rocketgit |
VOLUME /var/lib/rocketgit |
31 |
31 |
VOLUME /home/rocketgit |
VOLUME /home/rocketgit |
File docker/build.sh changed (mode: 100755) (index 6b6232f..07c89af) |
1 |
1 |
#!/bin/bash |
#!/bin/bash |
2 |
2 |
|
|
|
3 |
|
if [ "${1}" = "" ]; then |
|
4 |
|
op="" |
|
5 |
|
else |
|
6 |
|
op=${1} |
|
7 |
|
fi |
|
8 |
|
|
3 |
9 |
set -u |
set -u |
4 |
10 |
set -e |
set -e |
5 |
11 |
|
|
6 |
12 |
. ../duilder.conf |
. ../duilder.conf |
7 |
13 |
|
|
8 |
|
RP_VER="20200609" |
|
|
14 |
|
RP_VER="20210907" |
9 |
15 |
|
|
10 |
16 |
docker="podman" |
docker="podman" |
11 |
17 |
|
|
12 |
|
sed \ |
|
13 |
|
-e "s|@@RP_VER@@|${RP_VER}|" \ |
|
14 |
|
Dockerfile-postgresql.tmpl > Dockerfile-postgresql |
|
15 |
|
if [ "`${docker} images -q rocketgit/rocketgit-postgresql:${RP_VER}`" = "" ]; then |
|
16 |
|
echo "Building rocketgit-postgresql (${RP_VER})..." |
|
17 |
|
${docker} build \ |
|
18 |
|
--net container \ |
|
19 |
|
--tag="rocketgit/rocketgit-postgresql:${RP_VER}" \ |
|
20 |
|
-f Dockerfile-postgresql \ |
|
21 |
|
. |
|
22 |
|
${docker} tag "rocketgit/rocketgit-postgresql:${RP_VER}" \ |
|
23 |
|
"rocketgit/rocketgit-postgresql:latest" |
|
24 |
|
fi |
|
|
18 |
|
# We use official postgresql image |
|
19 |
|
#sed \ |
|
20 |
|
# -e "s|@@RP_VER@@|${RP_VER}|" \ |
|
21 |
|
# Dockerfile-postgresql.tmpl > Dockerfile-postgresql |
|
22 |
|
#if [ "`${docker} images -q rocketgit/rocketgit-postgresql:${RP_VER}`" = "" ]; then |
|
23 |
|
# echo "Building rocketgit-postgresql (${RP_VER})..." |
|
24 |
|
# ${docker} build \ |
|
25 |
|
# --net container \ |
|
26 |
|
# --tag="rocketgit/rocketgit-postgresql:${RP_VER}" \ |
|
27 |
|
# -f Dockerfile-postgresql \ |
|
28 |
|
# . |
|
29 |
|
# ${docker} tag "rocketgit/rocketgit-postgresql:${RP_VER}" \ |
|
30 |
|
# "rocketgit/rocketgit-postgresql:latest" |
|
31 |
|
#fi |
25 |
32 |
|
|
26 |
33 |
|
|
|
34 |
|
if [ "${op}" = "dev" ]; then |
|
35 |
|
f="Dockerfile-rocketgit-dev" |
|
36 |
|
v="dev" |
|
37 |
|
tag="dev" |
|
38 |
|
else |
|
39 |
|
f="Dockerfile-rocketgit" |
|
40 |
|
v="${VER}" |
|
41 |
|
tag="latest" |
|
42 |
|
fi |
27 |
43 |
echo "Building rocketgit (fedora)..." |
echo "Building rocketgit (fedora)..." |
28 |
|
sed -e "s|@@VER@@|${VER}|" Dockerfile-rocketgit.tmpl > Dockerfile-rocketgit |
|
|
44 |
|
sed -e "s|@@VER@@|${VER}|" ${f}.tmpl > ${f} |
29 |
45 |
${docker} build \ |
${docker} build \ |
30 |
|
--tag="rocketgit/rocketgit:${VER}" \ |
|
31 |
|
-f Dockerfile-rocketgit \ |
|
|
46 |
|
--tag="rocketgit/rocketgit:${v}" \ |
|
47 |
|
-f ${f} \ |
32 |
48 |
. |
. |
33 |
|
${docker} tag "rocketgit/rocketgit:${VER}" "rocketgit/rocketgit:latest" |
|
|
49 |
|
if [ "${op}" != "dev" ]; then |
|
50 |
|
${docker} tag "rocketgit/rocketgit:${v}" "rocketgit/rocketgit:${tag}" |
|
51 |
|
fi |
34 |
52 |
|
|
35 |
53 |
|
|
36 |
54 |
# This is not working because alpine's chmod does not know about --reference |
# This is not working because alpine's chmod does not know about --reference |
File docker/rg.sh changed (mode: 100755) (index 3bc1df6..079ca37) |
2 |
2 |
|
|
3 |
3 |
# This file will be included in docker 'rocketgit' Dockerfile |
# This file will be included in docker 'rocketgit' Dockerfile |
4 |
4 |
|
|
5 |
|
sed -i -e "s|\$rg_sql = .*$|\$rg_sql = 'host=${RP_PORT_5432_TCP_ADDR} port=${RP_PORT_5432_TCP_PORT} user=rocketgit dbname=rocketgit connect_timeout=10';|" /etc/rocketgit/config.php |
|
|
5 |
|
# Exporting vars seems is not hitting php-fpm :( |
|
6 |
|
# Probably it sanitizes the environment. |
|
7 |
|
if [ "${RG_DEBUG}" != "" ]; then |
|
8 |
|
echo ${RG_DEBUG} > /home/rocketgit/rg_debug |
|
9 |
|
fi |
|
10 |
|
if [ "${RG_SQL_ADD}" != "" ]; then |
|
11 |
|
echo "${RG_SQL_ADD}" > /home/rocketgit/sql_add |
|
12 |
|
fi |
|
13 |
|
|
|
14 |
|
list="/var/log/rocketgit |
|
15 |
|
/var/lib/rocketgit |
|
16 |
|
/var/lib/rocketgit/locks |
|
17 |
|
/var/lib/rocketgit/sockets |
|
18 |
|
/var/lib/rocketgit/repos |
|
19 |
|
/var/lib/rocketgit/q_merge_requests |
|
20 |
|
/var/lib/rocketgit/qstats |
|
21 |
|
/var/lib/rocketgit/tmp" |
|
22 |
|
mkdir ${list} |
|
23 |
|
chown rocketgit:rocketgit ${list} |
|
24 |
|
chmod o= ${list} |
|
25 |
|
|
|
26 |
|
chmod 0771 /var/lib/rocketgit |
6 |
27 |
|
|
7 |
28 |
echo "Generating sshd keys..." |
echo "Generating sshd keys..." |
8 |
29 |
for i in rsa ecdsa ed25519; do |
for i in rsa ecdsa ed25519; do |
|
... |
... |
if [ ! -r /etc/pki/tls/certs/localhost.crt ]; then |
20 |
41 |
-out /etc/pki/tls/certs/localhost.crt |
-out /etc/pki/tls/certs/localhost.crt |
21 |
42 |
fi |
fi |
22 |
43 |
|
|
23 |
|
( |
|
24 |
|
sed -i -e 's/ default_server//g' /etc/nginx/nginx.conf |
|
25 |
|
|
|
26 |
|
cd /etc/nginx/conf.d |
|
27 |
|
sed -r \ |
|
28 |
|
-e 's/listen (.*);/listen \1 default_server;/g' \ |
|
29 |
|
rocketgit.conf.sample \ |
|
30 |
|
> rocketgit.conf |
|
31 |
|
) |
|
32 |
|
|
|
33 |
44 |
while [ 1 ]; do |
while [ 1 ]; do |
34 |
45 |
# rocketgit-fpm will be started automatically! |
# rocketgit-fpm will be started automatically! |
35 |
46 |
if [ "`ps ax|grep -v grep|grep \"pool rocketgit\"`" = "" ]; then |
if [ "`ps ax|grep -v grep|grep \"pool rocketgit\"`" = "" ]; then |
|
... |
... |
while [ 1 ]; do |
49 |
60 |
fi |
fi |
50 |
61 |
fi |
fi |
51 |
62 |
|
|
52 |
|
if [ "`ps ax|grep -v grep|grep cron`" = "" ]; then |
|
53 |
|
echo "Running cron..." |
|
54 |
|
crond |
|
|
63 |
|
su - rocketgit -c /usr/share/rocketgit/scripts/cache.sh & |
|
64 |
|
su - rocketgit -c /usr/share/rocketgit/scripts/cron.sh & |
|
65 |
|
su - rocketgit -c /usr/share/rocketgit/scripts/events.sh & |
|
66 |
|
su - rocketgit -c /usr/share/rocketgit/scripts/builder.sh & |
|
67 |
|
#su - rocketgit -c /usr/share/rocketgit/scripts/worker.sh & |
|
68 |
|
|
|
69 |
|
# More work to do here |
|
70 |
|
#if [ "`ps ax|grep -v grep|grep git-daemon`" = "" ]; then |
|
71 |
|
# echo "Running git-daemon..." |
|
72 |
|
# /usr/libexec/git-core/git-daemon --base-path=/var/lib/git \ |
|
73 |
|
# --export-all --user-path=public_git \ |
|
74 |
|
# --inetd --log-destination=stderr --verbose |
|
75 |
|
# if [ "${?}" != "0" ]; then |
|
76 |
|
# echo "ERROR: could not start git-daemon!" |
|
77 |
|
# fi |
|
78 |
|
#fi |
|
79 |
|
|
|
80 |
|
if [ "`ps ax|grep -v grep|grep sshd`" = "" ]; then |
|
81 |
|
echo "Running sshd..." |
|
82 |
|
/usr/sbin/sshd &>/tmp/sshd.log |
55 |
83 |
if [ "${?}" != "0" ]; then |
if [ "${?}" != "0" ]; then |
56 |
|
echo "ERROR: could not start crond!" |
|
|
84 |
|
echo "ERROR: could not start sshd!" |
57 |
85 |
fi |
fi |
58 |
86 |
fi |
fi |
59 |
87 |
|
|
|
... |
... |
while [ 1 ]; do |
65 |
93 |
fi |
fi |
66 |
94 |
fi |
fi |
67 |
95 |
|
|
68 |
|
if [ "`ps ax|grep -v grep|grep xinetd`" = "" ]; then |
|
69 |
|
echo "Running xinetd..." |
|
70 |
|
/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid |
|
71 |
|
if [ "${?}" != "0" ]; then |
|
72 |
|
echo "ERROR: could not start xinetd!" |
|
73 |
|
fi |
|
74 |
|
fi |
|
75 |
|
|
|
76 |
|
if [ "`ps ax|grep -v grep|grep sshd`" = "" ]; then |
|
77 |
|
echo "Running sshd..." |
|
78 |
|
/usr/sbin/sshd &>/tmp/sshd.log |
|
79 |
|
if [ "${?}" != "0" ]; then |
|
80 |
|
echo "ERROR: could not start sshd!" |
|
81 |
|
fi |
|
82 |
|
fi |
|
83 |
|
|
|
84 |
96 |
sleep 30 |
sleep 30 |
85 |
97 |
done |
done |
|
98 |
|
|