Update Dockerfile
Browse files- Dockerfile +12 -7
Dockerfile
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
|
|
| 1 |
FROM python:3.11-alpine
|
| 2 |
|
|
|
|
| 3 |
LABEL name="Comet" \
|
| 4 |
description="Stremio's fastest torrent/debrid search add-on." \
|
| 5 |
url="https://github.com/g0ldyy/comet"
|
| 6 |
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
|
|
|
| 9 |
ARG DATABASE_PATH
|
| 10 |
|
| 11 |
# Environment variables for Python and Poetry
|
|
@@ -13,27 +17,28 @@ ENV PYTHONUNBUFFERED=1 \
|
|
| 13 |
PYTHONDONTWRITEBYTECODE=1 \
|
| 14 |
POETRY_NO_INTERACTION=1 \
|
| 15 |
POETRY_HOME="/usr/local" \
|
|
|
|
| 16 |
FORCE_COLOR=1 \
|
| 17 |
TERM=xterm-256color
|
| 18 |
|
| 19 |
-
# Install necessary build dependencies
|
| 20 |
RUN apk add --no-cache \
|
| 21 |
gcc \
|
| 22 |
musl-dev \
|
| 23 |
libffi-dev \
|
| 24 |
make \
|
| 25 |
-
python3-dev #
|
| 26 |
|
| 27 |
# Install Poetry
|
| 28 |
-
RUN pip install poetry
|
| 29 |
|
| 30 |
-
# Copy only the Poetry files
|
| 31 |
COPY pyproject.toml poetry.lock ./
|
| 32 |
|
| 33 |
-
# Install dependencies
|
| 34 |
-
RUN poetry install --no-
|
| 35 |
|
| 36 |
-
#
|
| 37 |
COPY . .
|
| 38 |
|
| 39 |
# Entrypoint to run the application
|
|
|
|
| 1 |
+
# Use Alpine-based Python image for a smaller image size
|
| 2 |
FROM python:3.11-alpine
|
| 3 |
|
| 4 |
+
# Metadata as described in your project
|
| 5 |
LABEL name="Comet" \
|
| 6 |
description="Stremio's fastest torrent/debrid search add-on." \
|
| 7 |
url="https://github.com/g0ldyy/comet"
|
| 8 |
|
| 9 |
+
# Set the working directory inside the container
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# Optional: Argument for database path if needed in your app
|
| 13 |
ARG DATABASE_PATH
|
| 14 |
|
| 15 |
# Environment variables for Python and Poetry
|
|
|
|
| 17 |
PYTHONDONTWRITEBYTECODE=1 \
|
| 18 |
POETRY_NO_INTERACTION=1 \
|
| 19 |
POETRY_HOME="/usr/local" \
|
| 20 |
+
PATH="$PATH:$POETRY_HOME/bin" \
|
| 21 |
FORCE_COLOR=1 \
|
| 22 |
TERM=xterm-256color
|
| 23 |
|
| 24 |
+
# Install necessary build dependencies
|
| 25 |
RUN apk add --no-cache \
|
| 26 |
gcc \
|
| 27 |
musl-dev \
|
| 28 |
libffi-dev \
|
| 29 |
make \
|
| 30 |
+
python3-dev # Required for building some Python packages
|
| 31 |
|
| 32 |
# Install Poetry
|
| 33 |
+
RUN pip install --no-cache-dir poetry
|
| 34 |
|
| 35 |
+
# Copy only the Poetry files and install dependencies first
|
| 36 |
COPY pyproject.toml poetry.lock ./
|
| 37 |
|
| 38 |
+
# Install dependencies without development packages
|
| 39 |
+
RUN poetry install --no-root --no-dev
|
| 40 |
|
| 41 |
+
# Copy the rest of your application code to the image
|
| 42 |
COPY . .
|
| 43 |
|
| 44 |
# Entrypoint to run the application
|