Project

General

Profile

« Previous | Next » 

Revision 41

Added by Laurent RIVIERE 12 months ago

add docker

View differences:

branches/5.0.x/docker/SCENARIsuite-starter/Dockerfile
1
FROM debian:10
2

  
3
ENV LANG C.UTF-8
4
ENV OOO_DISABLE_RECOVERY 1
5
ENV DISPLAY :1.0
6
ENV DEBIAN_FRONTEND noninteractive
7

  
8
RUN apt-get update && \
9
    apt-get install -y ffmpeg imagemagick jetty9 curl pwgen dumb-init && \
10
    apt-get install --no-install-recommends -y fonts-noto fonts-noto-cjk fonts-noto-unhinted fonts-noto-color-emoji fonts-noto-ui-core fonts-noto-mono fonts-liberation fontconfig && \
11
    apt-get install --no-install-recommends -y libreoffice libreoffice-java-common ure && \
12
    apt-get install --no-install-recommends -y texlive-latex-base texlive-latex-extra texlive-science texlive-fonts-recommended dvipng && \
13
    rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
14

  
15
ENV PS_DEB https://gitlab.com/postscriptum.app/cli/-/jobs/304457680/artifacts/raw/postscriptum-app-v0.8.006-linux.deb?inline=false
16
RUN curl -qs "$PS_DEB" -o /tmp/ps.deb && \
17
    dpkg -i /tmp/ps.deb && \
18
    rm -f /tmp/ps.deb
19

  
20
#ENV PS_NO_CHROMIUM_SANDBOX true
21
RUN perl -pi -e 's|, "--font-render-hinting=medium"|, "--font-render-hinting=medium", "--no-sandbox"|' /opt/postscriptum/cli/dist/cli.js
22

  
23
ENV SC_WEBAPP_NAME scsuitestr50
24

  
25
# Nightly SC TGZ
26
ENV SC_BASE_URL https://builds.kelis.fr/job/SCsuiteStarter-5.0/lastSuccessfulBuild
27
RUN SC_TGZ=$SC_BASE_URL/artifact/$(curl -qs "$SC_BASE_URL/api/xml?xpath=/freeStyleBuild/artifact/relativePath\[contains(text(),'Linux_x86_64.tgz')\]" | tr '<>' ' ' |cut -d ' ' -f 3) && \
28
    curl -qs "$SC_TGZ"  -o /tmp/SCENARI.tgz && \
29
    mkdir /var/cache/scenari && \
30
    tar zxf /tmp/SCENARI.tgz --strip 1 -C /var/cache/scenari && \
31
    chown -R jetty:jetty /var/cache/scenari && \
32
    rm -f /tmp/SCENARI.tgz
33

  
34
# Release SC TGZ
35
#ENV SC_TGZ https://download.scenari.software/SCENARIchain-server@5.0.0.00/SCENARIserver_5.0.000beta_201910101200.Linux_x86_64.tgz
36
#RUN curl -qs "$SC_TGZ"  -o /tmp/SCENARI.tgz && \
37
#    mkdir /var/cache/scenari && \
38
#    tar zxf /tmp/SCENARI.tgz --strip 1 -C /var/cache/scenari && \
39
#    chown -R jetty:jetty /var/cache/scenari && \
40
#    rm -f /tmp/SCENARI.tgz
41

  
42
RUN mkdir -p /var/lib/scenari /var/log/scenari && \
43
    chown -R jetty:jetty /var/lib/scenari /var/log/scenari && \
44
    usermod -d /var/lib/scenari jetty && \
45
    rm -rf /var/lib/jetty9/webapps/root
46

  
47
COPY jetty-start.ini /etc/jetty9/start.ini
48
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
49

  
50
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
51

  
52
VOLUME /var/lib/scenari
53
WORKDIR /var/lib/scenari
54

  
55
USER jetty
56
EXPOSE 8080
57

  
58
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
59
CMD ["/usr/bin/dumb-init", "--", "/usr/bin/java", "-XX:InitialRAMPercentage=40", "-XX:MaxRAMPercentage=60", "-Djava.awt.headless=true", "-Djetty.home=/usr/share/jetty9", "-Djetty.base=/usr/share/jetty9", "-Djava.io.tmpdir=/tmp", "-jar", "/usr/share/jetty9/start.jar", "jetty.state=/var/lib/jetty9/jetty.state", "jetty-started.xml"]
branches/5.0.x/docker/SCENARIsuite-starter/docker-entrypoint.sh
1
#!/bin/bash
2
if [ -z "$SC_PUBLIC_URL" ] ; then
3
  echo 'SC_PUBLIC_URL is mandatory.'
4
  echo "    example: SC_PUBLIC_URL=http://mydomain:8080/$SC_WEBAPP_NAME"
5
  exit 1
6
else
7
  echo "Example reverse proxy: $SC_PUBLIC_URL => http://CONTAINER_IP:PUBLISH_PORT/$SC_WEBAPP_NAME"
8
fi
9

  
10
if [ -z "$SC_USER_SYSTEM_PASS" ] ; then
11
  export SC_USER_SYSTEM_PASS=$(pwgen -s 32 1)
12
  echo "Generated password for user 'system': $SC_USER_SYSTEM_PASS"
13
fi
14
if [ -z "$SC_USER_SADMIN_PASS" ] ; then
15
  export SC_USER_SADMIN_PASS=$(pwgen -s 32 1)
16
  echo "Generated password for user 'superadmin': $SC_USER_SADMIN_PASS"
17
fi
18

  
19
cd /var/cache/scenari
20
# SET PASSWORD
21
perl -pi -e "s|user.system.password=ErT8MpdUH7oPlXtH|user.system.password=$SC_USER_SYSTEM_PASS|" conf/users.properties
22
perl -pi -e "s|user.superadmin.password=FuT5MpdUH7oPrXtW|user.superadmin.password=$SC_USER_SUPERADMIN_PASS|" conf/users.properties
23

  
24
# SET URL
25
perl -pi -e "s|webapp.public.url=http://192.168.0.1:8080/scchainsrv50|webapp.public.url=$SC_PUBLIC_URL|" conf/webapp.properties
26
if [ ! -z "SC_WEBAPP_NAME" ] ; then
27
  perl -pi -e "s|webapp.code=scsuitestr50|webapp.code=$SC_WEBAPP_NAME|" conf/webapp.properties
28
fi
29

  
30
# SET PATH
31
perl -pi -e "s|webapp.work.dir=/var/lib/scsuitestr50|webapp.work.dir=/var/lib/scenari|" conf/webapp.properties
32
perl -pi -e "s|webapp.logs.dir=/var/log/scsuitestr50|webapp.logs.dir=/var/log/scenari|" conf/webapp.properties
33

  
34
# MAKE WAR
35
./makeSrv.sh > /dev/null
36
# INSTALL WAR
37
cp -a /var/cache/scenari/_release/*.war /var/lib/jetty9/webapps
38

  
39
cd /var/lib/scenari
40
exec "$@"
branches/5.0.x/docker/SCENARIsuite-starter/jetty-start.ini
1
--lib=/usr/lib/libreoffice/program/classes/jurt.jar,/usr/lib/libreoffice/program/classes/ridl.jar,/usr/lib/libreoffice/program/classes/unoil.jar
2

  
3
--module=server
4
jetty.server.stopTimeout=120000
5
jetty.httpConfig.sendServerVersion=false
6

  
7
--module=deploy
8

  
9
--module=websocket
10

  
11
--module=http
12
jetty.http.port=8080
13
jetty.http.idleTimeout=60000
14

  
15
--module=requestlog
16
jetty.requestlog.append=true
17
jetty.requestlog.retainDays=366
18
jetty.requestlog.extended=true
19
jetty.requestlog.loglatency=true

Also available in: Unified diff