Understand, in heaven only say that about the sea. How infinitely beautiful it is ...
FROM debian:stretch ENV TZ Europe/Moscow ENV DEBIAN_FRONTEND noninteractive ENV DISPLAY :1 WORKDIR / RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf RUN ["mkdir", "-p", "/opt/fastreport/htdocs/bin"] RUN apt-get update \ && apt-get -y install apt-utils \ && apt-get -y install unzip \ && apt-get -y install mono-complete mono-xsp apache2 libapache2-mod-mono # Apache setup COPY 001-mono.conf /etc/apache2/sites-available/001-mono.conf RUN /usr/sbin/update-rc.d apache2 disable \ && /usr/sbin/a2dismod mod_mono_auto \ && /usr/sbin/a2dissite 000-default \ && /usr/sbin/a2ensite 001-mono # FastReport.Mono setup # Download official Demo ADD https://www.fastreport.ru/public_download/frmono_demo.zip /tmp/frmono_demo.zip # Or add from local filesystem #COPY frmono_demo.zip /tmp/frmono_demo.zip # Extract and copy to destinations RUN ["unzip", "/tmp/frmono_demo.zip", "-d", "/tmp/frmono.demo"] RUN cp -rp /tmp/frmono.demo/Demos/C#/Web/* /opt/fastreport/htdocs RUN cp /tmp/frmono.demo/FastReport.*.dll /opt/fastreport/htdocs/bin RUN chown -R www-data:www-data /opt/fastreport # Volume for X11 unix socket VOLUME /tmp/.X11-unix # Start Apache in foreground to prevent container exit CMD ["/usr/sbin/apachectl", "-DFOREGROUND"]
<VirtualHost *:80> DocumentRoot "/opt/fastreport/htdocs" <IfModule mod_mono.c> MonoUnixSocket FrSite /tmp/.mod_mono_server MonoServerPath FrSite /usr/bin/mod-mono-server4 MonoPath FrSite /usr/lib/mono/4.5:/usr/lib:/usr/lib/mono/4.0 AddMonoApplications FrSite "/:/opt/fastreport/htdocs" MonoAutoApplication Disabled MonoDocumentRootDir /opt/fastreport/htdocs MonoDebug false MonoSetEnv FrSite DISPLAY=:1;HOME=/opt/fastreport AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd </IfModule> <Directory "/opt/fastreport/htdocs"> Require all granted Options Indexes FollowSymLinks MultiViews AllowOverride All <IfModule mod_mono.c> SetHandler mono MonoSetServerAlias FrSite DirectoryIndex Default.aspx </IfModule> </Directory> <Directory "/opt/fastreport/htdocs/bin"> Require all denied </Directory> </VirtualHost>
docker build -t debian-stretch-mono:latest .
FROM debian:stretch ENV TZ Europe/Moscow ENV DEBIAN_FRONTEND noninteractive ENV DISPLAY :1 RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf RUN apt-get update \ && apt-get -y install apt-utils \ && apt-get -y install xserver-xorg-video-dummy x11-apps VOLUME /tmp/.X11-unix COPY xorg.mini.conf /etc/X11/xorg.conf CMD /usr/bin/Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile /tmp/xdummy.log -config /etc/X11/xorg.conf $DISPLAY
Section "ServerFlags" Option "DontVTSwitch" "true" Option "AllowMouseOpenFail" "true" Option "PciForceNone" "true" Option "AllowEmptyInput" "true" Option "AutoEnableDevices" "false" Option "AutoAddDevices" "false" EndSection Section "Device" Identifier "dummy_videocard" Driver "dummy" DacSpeed 600 Option "ConstantDPI" "true" VideoRam 256000 EndSection Section "Monitor" Identifier "dummy_monitor" HorizSync 1.0 - 2000.0 VertRefresh 1.0 - 200.0 Modeline "1920x1080" 23.53 1920 1952 2040 2072 1080 1106 1108 1135 Modeline "1280x1024" 31.50 1280 1312 1424 1456 1024 1048 1052 1076 Modeline "1280x720" 59.42 1280 1312 1536 1568 720 735 741 757 Modeline "1024x768" 18.71 1024 1056 1120 1152 768 786 789 807 EndSection Section "Screen" Identifier "dummy_screen" Device "dummy_videocard" Monitor "dummy_monitor" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 8 Modes "1920x1080" "1280x1024" "1280x800" "1024x768" Virtual 8192 4096 EndSubSection SubSection "Display" Viewport 0 0 Depth 16 Modes "1920x1080" "1280x1024" "1280x800" "1024x768" Virtual 8192 4096 EndSubSection SubSection "Display" Viewport 0 0 Depth 24 Modes "1920x1080" "1280x1024" "1280x800" "1024x768" Virtual 8192 4096 EndSubSection SubSection "Display" Viewport 0 0 Depth 30 Modes "1920x1080" "1280x1024" "1280x800" "1024x768" Virtual 8192 4096 EndSubSection EndSection Section "ServerLayout" Identifier "dummy_layout" Screen "dummy_screen" EndSection
docker build -t debian-stretch-x11dummy:latest .
version: "2" services: fastreport: container_name: frmono image: debian-stretch-mono:latest volumes: - ./.x11-unixsoc:/tmp/.X11-unix ports: - "127.0.0.1:8085:80" xorg: container_name: x11dummy image: debian-stretch-x11dummy:latest volumes: - ./.x11-unixsoc:/tmp/.X11-unix
docker-compose up
[Unit] Description=FastReport Docker Requires=docker.service After=docker.service [Service] Restart=always ExecStart=/usr/local/bin/docker-compose -f /opt/frdocker/docker-compose.yml start ExecStop=/usr/local/bin/docker-compose -f /opt/frdocker/docker-compose.yml stop [Install] WantedBy=multi-user.target
systemctl daemon-reload systemctl enable docker-frmono
docker images | grep "<none>" | awk '{split($0,a," ");print a[3];}' | xargs -I{} docker rmi "{}"
Source: https://habr.com/ru/post/351980/
All Articles