based deployment structure

This commit is contained in:
leca 2025-03-22 14:07:10 +03:00
parent e49a078c80
commit ba8fc1079a
6 changed files with 50 additions and 106 deletions

2
.gitignore vendored
View File

@ -124,3 +124,5 @@ checks-parser
deploy/appimage/AppDir/usr/share/doc/
deploy/appimage/AppDir/usr/share/
*.deb
binaries

View File

@ -1,34 +0,0 @@
FROM archlinux
#Update
RUN pacman --noconfirm -Sy
#Build dependencies
RUN pacman --noconfirm -S sudo cmake git coreutils base-devel qt5-base
RUN echo "MAKEFLAGS=\"-j${nproc}\"" >> /etc/makepkg.conf
RUN useradd -ms /bin/bash checks-parser
RUN usermod -a -G wheel checks-parser
RUN echo "checks-parser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER checks-parser
WORKDIR /home/checks-parser
#Dependencies from sources
RUN git clone https://aur.archlinux.org/yay.git && \
cd yay && \
makepkg -si --noconfirm && \
cd .. && sudo rm -rf yay
RUN yay -S opencv zbar nlohmann-json tesseract tesseract-data-rus
#building
WORKDIR /home/checks-parser
RUN git clone https://git.foxarmy.org/leca/checks-parser && \
cd checks-parser && \
cmake . && \
make -j ${nproc} && \
sudo make install
ENTRYPOINT ["checks-parser"]

View File

@ -1,34 +0,0 @@
FROM debian:bullseye
#Update
RUN apt update -y && apt upgrade -y
#Build dependencies
RUN apt install -y git build-essential cmake
#Dependencies from repos (qt5, openssl, tesseract and lang package)
RUN apt install -y qtbase5-dev openssl libmbedtls-dev tesseract-ocr tesseract-ocr-rus libopencv-dev
#Dependencies from sources
#cpr
WORKDIR /root
RUN git clone https://github.com/whoshuu/cpr.git && \
cd cpr && \
mkdir build && cd build && \
cmake .. && \
make -j ${nproc} && \
make install && \
cd /root && rm -rf cpr
#building
WORKDIR /root
RUN git clone https://git.foxarmy.org/leca/checks-parser && \
cd checks-parser && \
mkdir build && cd build &&\
cmake .. && \
make -j ${nproc} && \
make install && \
ENTRYPOINT ["checks-parser"]

View File

@ -1,11 +1,9 @@
FROM ubuntu:16.04
FROM checks_parser_base
# Installing dependencies
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y qtbase5-dev openssl libmbedtls-dev tesseract-ocr tesseract-ocr-rus libopencv-dev libzbar-dev qttools5-dev nlohmann-json-dev libcurl4-openssl-dev libtesseract-dev libqrencode-dev
RUN DEBIAN_FRONTEND=noninteractive apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y wget git cmake make gcc g++ fuse libboost-regex-dev
WORKDIR /
# Download linuxdeployqt
@ -13,44 +11,16 @@ RUN wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous
chmod +x /usr/bin/linuxdeployqt
# Prepare AppDir and its files
WORKDIR /appimage
RUN mkdir -p AppDir
WORKDIR /app
RUN mkdir -p AppDir/usr/bin
COPY deploy/appimage/checks-parser.desktop AppDir
COPY assets/icons/icon.png AppDir/checks-parser.png
COPY deploy/appimage/AppRun AppDir
RUN chmod +x AppDir/AppRun
RUN cp build/checks-parser /app/AppDir/usr/bin
#Copy only necessities
COPY assets ./assets
COPY check ./check
COPY exceptions ./exceptions
COPY goods ./goods
COPY image ./image
COPY image_redactor ./image_redactor
COPY output ./output
COPY parser ./parser
COPY settings ./settings
COPY scenes ./scenes
COPY net ./net
COPY translations ./translations
COPY http_server ./http_server
COPY utils ./utils
COPY ./*.h ./*cpp ./*.ui ./*.qrc CMakeLists.txt .
RUN mkdir build
WORKDIR /appimage/build
RUN cmake -DBUILD_TRANSLATIONS=on .. && make -j 8
WORKDIR /appimage/AppDir/usr/bin
RUN cp /appimage/build/checks-parser .
WORKDIR /appimage
RUN PATH=/usr/lib/qt5/bin/:$PATH linuxdeployqt --appimage-extract-and-run AppDir/usr/bin/checks-parser -no-copy-copyright-files -appimage
RUN PATH=/usr/lib/qt5/bin/:$PATH linuxdeployqt --appimage-extract-and-run AppDir/usr/bin/checks-parser -no-copy-copyright-files -appimage
RUN mkdir -p /output
ENTRYPOINT ["cp", "Checks_parser-x86_64.AppImage", "/output"]

View File

@ -0,0 +1,33 @@
FROM ubuntu:18.04
# Installing dependencies
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y qtbase5-dev openssl libmbedtls-dev tesseract-ocr tesseract-ocr-rus libopencv-dev libzbar-dev qttools5-dev nlohmann-json-dev libcurl4-openssl-dev libtesseract-dev libqrencode-dev
RUN DEBIAN_FRONTEND=noninteractive apt install -y wget git cmake make gcc g++ fuse libboost-regex-dev
WORKDIR /app
#Copy only necessities
COPY assets ./assets
COPY check ./check
COPY exceptions ./exceptions
COPY goods ./goods
COPY image ./image
COPY image_redactor ./image_redactor
COPY output ./output
COPY parser ./parser
COPY settings ./settings
COPY scenes ./scenes
COPY net ./net
COPY translations ./translations
COPY http_server ./http_server
COPY utils ./utils
COPY ./*.h ./*cpp ./*.ui ./*.qrc CMakeLists.txt .
WORKDIR /app/build
RUN cmake -DBUILD_TRANSLATIONS=on .. && make -j 8
ENTRYPOINT ["bash"]

View File

@ -1,7 +1,14 @@
services:
base:
image: checks_parser_base:latest
build:
context: .
dockerfile: deploy/base-docker/Dockerfile
appimage:
build:
dockerfile: deploy/appimage/Dockerfile
context: .
volumes:
- ./binaries:/output
depends_on:
- base