70 lines
3.2 KiB
Docker
70 lines
3.2 KiB
Docker
FROM node:22-bookworm-slim AS contentpanel-renderer
|
|
|
|
WORKDIR /build
|
|
COPY worker/contentpanel_aushang/renderer/package.json worker/contentpanel_aushang/renderer/package-lock.json ./
|
|
RUN npm ci --no-audit --no-fund
|
|
COPY worker/contentpanel_aushang/renderer/ ./
|
|
RUN npm run build \
|
|
&& test -s dist/app.js \
|
|
&& test -s dist/index.html
|
|
|
|
FROM php:8.3.33-apache-bookworm
|
|
|
|
ENV TZ=Europe/Berlin \
|
|
PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \
|
|
PATH=/opt/intranet-venv/bin:$PATH
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
locales tzdata \
|
|
python3 python3-venv \
|
|
openssh-client ghostscript poppler-utils pngquant \
|
|
tesseract-ocr tesseract-ocr-deu tesseract-ocr-eng \
|
|
libpq-dev libzip-dev \
|
|
libpng-dev libjpeg62-turbo-dev libfreetype6-dev \
|
|
&& echo 'de_DE.UTF-8 UTF-8' > /etc/locale.gen \
|
|
&& locale-gen \
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j"$(nproc)" pdo_pgsql pgsql zip gd \
|
|
&& php -r '$r=["pdo_pgsql","pgsql","curl","mbstring","dom","SimpleXML","xml","xmlreader","xmlwriter","zip","gd","Zend OPcache"]; foreach($r as $e){if(!extension_loaded($e)){fwrite(STDERR,"missing PHP ext: $e\n"); exit(1);}}' \
|
|
&& python3 -m venv /opt/intranet-venv \
|
|
&& /opt/intranet-venv/bin/pip install --no-cache-dir --upgrade pip \
|
|
&& /opt/intranet-venv/bin/pip install --no-cache-dir \
|
|
beautifulsoup4==4.13.4 fpdf==1.7.2 requests==2.32.4 playwright==1.62.0 \
|
|
&& /opt/intranet-venv/bin/python -m playwright install --with-deps chromium \
|
|
&& chmod -R a+rX /ms-playwright \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
ENV LANG=de_DE.UTF-8 \
|
|
LC_ALL=de_DE.UTF-8
|
|
|
|
COPY docker/intranet.ini /usr/local/etc/php/conf.d/99-intranet.ini
|
|
COPY docker/contentpanel-private.conf /etc/apache2/conf-enabled/contentpanel-private.conf
|
|
COPY web/ /var/www/html/
|
|
COPY worker/ /opt/intranet/worker/
|
|
RUN /opt/intranet-venv/bin/python -m compileall -q /opt/intranet/worker/contentpanel_aushang
|
|
COPY --from=contentpanel-renderer /build/dist/ /opt/intranet/worker/contentpanel_aushang/renderer/dist/
|
|
COPY docker/scheduler.py /opt/intranet/docker/scheduler.py
|
|
|
|
RUN mkdir -p \
|
|
/data/ckal-xlsx /data/pdf /data/state \
|
|
/var/www/html/intranet_repo/general_files/profile_pictures \
|
|
/var/www/html/intranet_repo/projects/contentpanel/insertion/news \
|
|
/var/www/html/intranet_repo/projects/developerpanel/work \
|
|
/var/www/html/intranet_repo/projects/seelsorge/data \
|
|
/var/www/html/intranet_repo/projects/dashboard/month \
|
|
&& chown -R www-data:www-data \
|
|
/data \
|
|
/var/www/html/intranet_repo/general_files/profile_pictures \
|
|
/var/www/html/intranet_repo/projects/contentpanel/insertion/news \
|
|
/var/www/html/intranet_repo/projects/developerpanel/work \
|
|
/var/www/html/intranet_repo/projects/seelsorge/data \
|
|
/var/www/html/intranet_repo/projects/dashboard/month \
|
|
&& chmod +x /opt/intranet/docker/scheduler.py /opt/intranet/worker/pdf_python/pdf_to_png.sh /opt/intranet/worker/contentpanel_aushang/process.py /opt/intranet/worker/contentpanel_aushang/betteroffice_render.py
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
|
CMD curl -fsS http://127.0.0.1/ >/dev/null || exit 1
|
|
|
|
CMD ["apache2-foreground"]
|