-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (43 loc) · 1.05 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
# Global ARG
ARG PYTHON_VERSION
# Build stage
FROM python:${PYTHON_VERSION}-alpine AS builder
# Install build dependencies
RUN apk add --no-cache \
binutils \
gcc \
musl-dev \
python3-dev \
libffi-dev \
make \
g++ \
zlib-dev \
rust \
cargo \
openssl \
openssl-dev \
pkgconfig
# Set environment variables for OpenSSL
ENV OPENSSL_DIR=/usr \
PKG_CONFIG_PATH=/usr/lib/pkgconfig
# Install Poetry and PyInstaller
RUN pip install --no-cache-dir poetry pyinstaller poethepoet
# Set working directory
WORKDIR /app
# Copy project files
COPY pyproject.toml poetry.lock ./
COPY qbittorrent_add_trackers ./qbittorrent_add_trackers
COPY build_scripts ./build_scripts
# Install project dependencies
RUN poetry install --no-dev
# Build binary
RUN poe package
# Final stage
FROM alpine
# Set working directory
WORKDIR /app
# Copy binary from build stage
COPY --from=builder /app/dist/qbittorrent-add-trackers /app/qbittorrent-add-trackers
COPY config.base.yaml ./
# Set entrypoint
ENTRYPOINT ["./qbittorrent-add-trackers"]