-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
78 lines (68 loc) · 2.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# syntax=docker/dockerfile:1
FROM debian:bookworm-slim AS bundle
COPY Gemfile Gemfile.lock /var/www/letter-avatars/
RUN <<'EOF' sh -exs
DEBIAN_FRONTEND=noninteractive apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
build-essential \
libffi-dev \
ruby-bundler \
ruby-dev
cd /var/www/letter-avatars
bundle config set deployment true
bundle config set without development:test
bundle install --verbose
EOF
FROM debian:bookworm-slim
RUN <<'EOF' sh -exs
DEBIAN_FRONTEND=noninteractive apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
imagemagick \
libcairo2 \
libfreetype6 \
libfribidi0 \
libgomp1 \
libgraphite2-3 \
libgs-common \
libharfbuzz0b \
libicu72 \
libjemalloc2 \
libltdl7 \
libpng16-16 \
libraqm0 \
pngquant \
ruby \
ruby-bundler \
tini \
util-linux
adduser --quiet --disabled-password --uid 9001 --gecos '' --shell /bin/bash web
DEBIAN_FRONTEND=noninteractive apt-get clean
( find /var/lib/apt/lists -mindepth 1 -delete || true )
( find /var/tmp -mindepth 1 -delete || true )
( find /tmp -mindepth 1 -delete || true )
EOF
COPY policy.xml /usr/local/etc/ImageMagick-7/
COPY --from=bundle --chown=9001 /var/www/letter-avatars /var/www/letter-avatars/
COPY --chown=9001 \
config.ru \
fonts/NotoSansArabic-Medium.ttf \
fonts/NotoSansArmenian-Medium.ttf \
fonts/NotoSansBengali-Medium.ttf \
fonts/NotoSansDevanagari-Medium.ttf \
fonts/NotoSansDisplay-Medium.ttf \
fonts/NotoSansHebrew-Medium.ttf \
fonts/NotoSansJavanese-Regular.ttf \
fonts/NotoSansMono-Medium.ttf \
fonts/NotoSansMonoCJKsc-Regular.otf \
fonts/NotoSansTelugu-Regular.ttf \
fonts/NotoSansThai-Medium.ttf \
fonts/Roboto-Medium \
unicorn.conf.rb \
/var/www/letter-avatars/
COPY --chown=9001 lib/ /var/www/letter-avatars/lib/
COPY as-web \
entrypoint \
/usr/local/sbin/
ENTRYPOINT ["/usr/local/sbin/entrypoint"]