Files
docuseal/Dockerfile
T

103 lines
4.5 KiB
Docker
Raw Normal View History

2026-01-26 18:18:07 +02:00
FROM ruby:4.0.1-alpine AS download
2024-01-07 14:19:21 +02:00
WORKDIR /fonts
2025-05-24 15:05:24 +03:00
RUN apk --no-cache add fontforge wget && \
wget https://github.com/satbyy/go-noto-universal/releases/download/v7.0/GoNotoKurrent-Regular.ttf && \
wget https://github.com/satbyy/go-noto-universal/releases/download/v7.0/GoNotoKurrent-Bold.ttf && \
wget https://github.com/impallari/DancingScript/raw/master/fonts/DancingScript-Regular.otf && \
wget https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansSymbols2/hinted/ttf/NotoSansSymbols2-Regular.ttf && \
wget https://github.com/Maxattax97/gnu-freefont/raw/master/ttf/FreeSans.ttf && \
wget https://github.com/impallari/DancingScript/raw/master/OFL.txt && \
2026-01-21 10:23:26 +02:00
wget -O /model.onnx "https://github.com/docusealco/fields-detection/releases/download/2.0.0/model_704_int8.onnx" && \
2025-05-24 15:05:24 +03:00
wget -O pdfium-linux.tgz "https://github.com/docusealco/pdfium-binaries/releases/latest/download/pdfium-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tgz" && \
mkdir -p /pdfium-linux && \
tar -xzf pdfium-linux.tgz -C /pdfium-linux
2024-03-13 14:58:28 +02:00
RUN fontforge -lang=py -c 'font1 = fontforge.open("FreeSans.ttf"); font2 = fontforge.open("NotoSansSymbols2-Regular.ttf"); font1.mergeFonts(font2); font1.generate("FreeSans.ttf")'
2024-01-07 14:19:21 +02:00
2026-01-26 18:18:07 +02:00
FROM ruby:4.0.1-alpine AS webpack
2023-06-24 22:50:12 +03:00
ENV RAILS_ENV=production
ENV NODE_ENV=production
WORKDIR /app
RUN apk add --no-cache nodejs yarn git build-base && \
gem install shakapacker
COPY ./package.json ./yarn.lock ./
RUN yarn install --network-timeout 1000000
COPY ./bin/shakapacker ./bin/shakapacker
COPY ./config/webpack ./config/webpack
COPY ./config/shakapacker.yml ./config/shakapacker.yml
2024-04-11 21:31:22 +03:00
COPY ./postcss.config.js ./postcss.config.js
COPY ./tailwind.config.js ./tailwind.config.js
COPY ./tailwind.form.config.js ./tailwind.form.config.js
COPY ./tailwind.application.config.js ./tailwind.application.config.js
2023-06-24 22:50:12 +03:00
COPY ./app/javascript ./app/javascript
COPY ./app/views ./app/views
RUN echo "gem 'shakapacker'" > Gemfile && ./bin/shakapacker
2026-01-26 18:18:07 +02:00
FROM ruby:4.0.1-alpine AS app
2023-06-24 22:50:12 +03:00
ENV RAILS_ENV=production
ENV BUNDLE_WITHOUT="development:test"
2024-05-02 10:01:31 +03:00
ENV LD_PRELOAD=/lib/libgcompat.so.0
2026-01-13 09:44:58 +02:00
ENV OPENSSL_CONF=/etc/openssl_legacy.cnf
2026-02-19 14:24:02 +02:00
ENV VIPS_MAX_COORD=10000
2023-06-24 22:50:12 +03:00
WORKDIR /app
2026-01-31 17:20:01 +02:00
RUN apk add --no-cache sqlite-dev libpq-dev vips-dev yaml-dev redis libheif vips-heif gcompat ttf-freefont onnxruntime && mkdir /fonts && rm /usr/share/fonts/freefont/FreeSans.otf
2023-06-24 22:50:12 +03:00
2026-01-12 10:02:17 +02:00
RUN addgroup -g 2000 docuseal && adduser -u 2000 -G docuseal -s /bin/sh -D -h /home/docuseal docuseal
2024-05-10 22:55:21 +03:00
RUN echo $'.include = /etc/ssl/openssl.cnf\n\
\n\
[provider_sect]\n\
default = default_sect\n\
legacy = legacy_sect\n\
\n\
[default_sect]\n\
activate = 1\n\
\n\
[legacy_sect]\n\
2026-01-13 09:44:58 +02:00
activate = 1' >> /etc/openssl_legacy.cnf
2024-05-10 22:55:21 +03:00
2026-01-13 09:44:58 +02:00
COPY --chown=docuseal:docuseal ./Gemfile ./Gemfile.lock ./
2023-06-24 22:50:12 +03:00
2026-01-31 17:20:01 +02:00
RUN apk add --no-cache build-base git && bundle install && apk del --no-cache build-base git && rm -rf ~/.bundle /usr/local/bundle/cache && ruby -e "puts Dir['/usr/local/bundle/**/{spec,rdoc,resources/shared,resources/collation,resources/locales}']" | xargs rm -rf && ln -sf /usr/lib/libonnxruntime.so.1 $(ruby -e "print Dir[Gem::Specification.find_by_name('onnxruntime').gem_dir + '/vendor/*.so'].first")
2025-10-28 10:52:37 +02:00
2026-01-13 09:44:58 +02:00
COPY --chown=docuseal:docuseal ./bin ./bin
COPY --chown=docuseal:docuseal ./app ./app
COPY --chown=docuseal:docuseal ./config ./config
COPY --chown=docuseal:docuseal ./db/migrate ./db/migrate
COPY --chown=docuseal:docuseal ./log ./log
COPY --chown=docuseal:docuseal ./lib ./lib
COPY --chown=docuseal:docuseal ./public ./public
COPY --chown=docuseal:docuseal ./tmp ./tmp
2026-02-21 08:26:09 +02:00
COPY --chown=docuseal:docuseal LICENSE LICENSE_ADDITIONAL_TERMS README.md Rakefile config.ru .version ./
2026-01-13 09:44:58 +02:00
COPY --chown=docuseal:docuseal .version ./public/version
COPY --chown=docuseal:docuseal --from=download /fonts/GoNotoKurrent-Regular.ttf /fonts/GoNotoKurrent-Bold.ttf /fonts/DancingScript-Regular.otf /fonts/OFL.txt /fonts
2025-05-24 15:05:24 +03:00
COPY --from=download /fonts/FreeSans.ttf /usr/share/fonts/freefont
COPY --from=download /pdfium-linux/lib/libpdfium.so /usr/lib/libpdfium.so
COPY --from=download /pdfium-linux/licenses/pdfium.txt /usr/lib/libpdfium-LICENSE.txt
2026-01-13 09:44:58 +02:00
COPY --chown=docuseal:docuseal --from=download /model.onnx /app/tmp/model.onnx
COPY --chown=docuseal:docuseal --from=webpack /app/public/packs ./public/packs
2023-06-24 22:50:12 +03:00
2026-01-13 09:44:58 +02:00
RUN ln -s /fonts /app/public/fonts && \
bundle exec bootsnap precompile -j 1 --gemfile app/ lib/ && \
chown -R docuseal:docuseal /app/tmp/cache
2026-01-12 10:02:17 +02:00
2023-06-24 22:50:12 +03:00
WORKDIR /data/docuseal
2026-01-12 10:02:17 +02:00
ENV HOME=/home/docuseal
2023-06-24 22:50:12 +03:00
ENV WORKDIR=/data/docuseal
EXPOSE 3000
2024-03-26 01:17:53 +02:00
CMD ["/app/bin/bundle", "exec", "puma", "-C", "/app/config/puma.rb", "--dir", "/app"]