|
|
@@ -1,12 +1,22 @@
|
|
|
-FROM python:3.14-alpine
|
|
|
+# ---------- BUILD STAGE ----------
|
|
|
+FROM python:3.14-alpine AS builder
|
|
|
|
|
|
-RUN apk add mariadb-connector-c mariadb-connector-c-dev build-base
|
|
|
+RUN apk add --no-cache build-base mariadb-connector-c-dev
|
|
|
|
|
|
-WORKDIR /opt/MyAnimeBot
|
|
|
+WORKDIR /build
|
|
|
|
|
|
COPY requirements.txt .
|
|
|
|
|
|
-RUN pip install --no-cache-dir -r requirements.txt
|
|
|
+RUN pip install --prefix=/install -r requirements.txt
|
|
|
+
|
|
|
+# ---------- RUNTIME STAGE ----------
|
|
|
+FROM python:3.14-alpine
|
|
|
+
|
|
|
+RUN apk add mariadb-connector-c
|
|
|
+
|
|
|
+COPY --from=builder /install /usr/local
|
|
|
+
|
|
|
+WORKDIR /opt/MyAnimeBot
|
|
|
|
|
|
COPY . .
|
|
|
|