Browse Source

New Dockerfile

Penta 1 month ago
parent
commit
743baee990
1 changed files with 14 additions and 4 deletions
  1. 14 4
      Dockerfile

+ 14 - 4
Dockerfile

@@ -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 . .