-
Notifications
You must be signed in to change notification settings - Fork 80
/
Dockerfile
83 lines (75 loc) · 1.56 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
# Build Python package and dependencies
FROM python:3.11-alpine AS python-build
RUN apk add --no-cache \
git \
libffi-dev \
musl-dev \
gcc \
g++ \
make \
zlib-dev \
tiff-dev \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
lcms2-dev \
libwebp-dev \
openssl-dev
RUN mkdir -p /opt/venv
WORKDIR /opt/venv
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN mkdir -p /src
WORKDIR /src
# Install bot package and dependencies
COPY . .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Package everything
FROM python:3.11-alpine AS final
# Update system first
RUN apk update
# Install optional native tools (for full functionality)
RUN apk add --no-cache \
curl \
neofetch \
git \
nss
# Install native dependencies
RUN apk add --no-cache \
libffi \
musl \
gcc \
g++ \
make \
tiff \
freetype \
libpng \
libjpeg-turbo \
lcms2 \
libwebp \
openssl \
zlib \
busybox \
sqlite \
libxml2 \
libssh2 \
ca-certificates \
ffmpeg \
libvpx \
x264-libs \
x265 \
libvorbis \
opus \
libass \
xvidcore \
lame
# Setup runtime files
RUN mkdir -p /caligo
WORKDIR /caligo
COPY . .
# Copy Python venv
ENV PATH="/opt/venv/bin:$PATH"
COPY --from=python-build /opt/venv /opt/venv
# Set runtime settings
CMD ["python3", "-m", "caligo"]