-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·129 lines (104 loc) · 4.76 KB
/
Copy pathDockerfile
File metadata and controls
executable file
·129 lines (104 loc) · 4.76 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
FROM debian:12 AS min-cli
ENV HOME=/home/app \
PYENV_ROOT=/home/app/.pyenv \
PATH="/home/app/.pyenv/shims:/home/app/.pyenv/bin:$PATH"
RUN useradd --create-home app && \
apt update -y && \
apt install --no-install-recommends -y git curl gettext ca-certificates \
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev \
libssl-dev lzma lzma-dev uuid-dev xvfb zlib1g-dev && \
update-ca-certificates && \
curl -fsSL https://pyenv.run | bash && \
pyenv install 3.13 && \
pyenv global 3.13 && \
pyenv rehash && \
apt purge -y build-essential curl git gdb lcov libbz2-dev libffi-dev libgdbm-dev \
liblzma-dev libncurses5-dev libreadline6-dev libsqlite3-dev \
libssl-dev lzma-dev uuid-dev zlib1g-dev && \
apt clean autoclean && \
apt autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
WORKDIR /app
COPY ./requirements.txt /app/
RUN pip3 install --no-cache-dir -r requirements.txt
COPY ./src /app/
COPY ./scripts/update-locales.sh /app/scripts/update-locales.sh
RUN /app/scripts/update-locales.sh /app
USER app
VOLUME ["/app/sticker_convert/stickers_input", "/app/sticker_convert/stickers_output"]
ENTRYPOINT ["/home/app/.pyenv/shims/python", "/app/sticker-convert.py"]
FROM jlesage/baseimage-gui:debian-12-v4.11 AS base-gui
WORKDIR /app
ENV HOME=/home/app \
PYENV_ROOT=/home/app/.pyenv \
PATH="/home/app/.pyenv/shims:/home/app/.pyenv/bin:$PATH" \
DISPLAY_WIDTH=1920 \
DISPLAY_HEIGHT=1080
RUN mkdir -p '/home/app' && \
chmod -R 777 '/home/app' && \
# Install dependency
apt update -y && \
apt install --no-install-recommends -y ca-certificates \
curl gpg zip unzip sed locales binutils psmisc git libtk8.6 \
libfribidi-dev libharfbuzz-dev libx11-6 libfontconfig gettext \
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev \
libssl-dev lzma lzma-dev tk-dev uuid-dev xvfb zlib1g-dev && \
update-ca-certificates && \
# Set locales
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen && \
# Build python
curl -fsSL https://pyenv.run | bash && \
pyenv install 3.13 && \
pyenv global 3.13 && \
pyenv rehash && \
# Cleanup python build requirements
apt purge -y build-essential git gdb lcov libbz2-dev libffi-dev libgdbm-dev \
liblzma-dev libncurses5-dev libreadline6-dev libsqlite3-dev \
libssl-dev lzma-dev tk-dev uuid-dev zlib1g-dev && \
apt clean autoclean && \
apt autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
# Set application name displayed in Webpage
RUN set-cont-env APP_NAME "sticker-convert"
# Generate and install favicons.
COPY ./src/sticker_convert/resources/appicon.png /app/
RUN APP_ICON_URL=/app/appicon.png && \
install_app_icon.sh "$APP_ICON_URL"
RUN mkdir /etc/openbox && \
printf '<Type>normal</Type>\n<Name>sticker-convert</Name>' >> /etc/openbox/main-window-selection.xml
COPY ./requirements.txt /app/
RUN pip3 install --no-cache-dir -r requirements.txt
COPY ./scripts/startapp.sh /startapp.sh
VOLUME ["/app/sticker_convert/stickers_input", "/app/sticker_convert/stickers_output"]
FROM base-gui AS min-gui
COPY ./src /app/
COPY ./scripts/update-locales.sh /app/scripts/update-locales.sh
RUN /app/scripts/update-locales.sh /app
FROM base-gui AS full
# QT_QUICK_BACKEND for chromium
ENV QT_QUICK_BACKEND="software"
# Install signal-desktop
RUN curl -s https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg && \
cat signal-desktop-keyring.gpg | tee -a /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null && \
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |\
tee -a /etc/apt/sources.list.d/signal-xenial.list && \
apt update -y && \
apt install --no-install-recommends -y signal-desktop
# Install Viber Desktop
RUN curl -o /tmp/viber.deb -L https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb && \
apt install --no-install-recommends -y /tmp/viber.deb libgl1 libevent-2.1-7 libwebpdemux2 libxslt1.1 libxkbfile1 libegl1 libopengl0 libqt5gui5 && \
rm /tmp/viber.deb
# Install Chromium
RUN apt install --no-install-recommends -y chromium
# Additional language support
RUN sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# zh_TW.UTF-8 UTF-8/zh_TW.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
RUN apt install --no-install-recommends -y fonts-noto-cjk
COPY ./src /app/
COPY ./scripts/update-locales.sh /app/scripts/update-locales.sh
RUN /app/scripts/update-locales.sh /app