-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile
executable file
·100 lines (71 loc) · 3.15 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
FROM debian:11 AS min-cli
WORKDIR /app
RUN apt update -y && \
apt install --no-install-recommends -y python3 python3-pip
COPY ./requirements.txt /app/
RUN cat requirements.txt | grep -v 'ttkbootstrap' > requirements-cli.txt &&\
rm requirements.txt &&\
pip3 install --no-cache-dir -r requirements-cli.txt
COPY ./src /app/
RUN apt purge -y python3-pip && \
apt clean autoclean && \
apt autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
RUN useradd --create-home app
USER app
VOLUME ["/app/sticker_convert/stickers_input", "/app/sticker_convert/stickers_output"]
ENTRYPOINT ["/app/sticker-convert.py"]
FROM jlesage/baseimage-gui:debian-11-v4 AS base-gui
WORKDIR /app
# Install dependency
RUN apt update -y && \
apt install --no-install-recommends -y python3 python3-pip python3-opencv python3-tk \
curl wget gpg zip unzip sed locales binutils psmisc git \
libfribidi-dev libharfbuzz-dev libx11-6 libfontconfig
# Set locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
# 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"
ENV DISPLAY_WIDTH=1920
ENV DISPLAY_HEIGHT=1080
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
ENV HOME=/home/app
VOLUME ["/app/sticker_convert/stickers_input", "/app/sticker_convert/stickers_output"]
FROM base-gui AS min-gui
RUN apt purge -y curl wget gpg git && \
apt clean autoclean && \
apt autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
COPY ./src /app/
FROM base-gui AS full
# Install signal-desktop
RUN wget -O- 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 Discord Desktop
RUN curl -o /tmp/discord.deb -L "https://discord.com/api/download?platform=linux&format=deb" && \
apt install --no-install-recommends -y /tmp/discord.deb && \
rm /tmp/discord.deb
ENV QT_QUICK_BACKEND="software"
RUN apt purge -y curl wget gpg git && \
apt clean autoclean && \
apt autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
COPY ./src /app/
RUN mkdir -p '/home/app' && \
chmod -R 777 '/home/app'