Update Dockerfile
Browse files- Dockerfile +15 -23
Dockerfile
CHANGED
|
@@ -4,43 +4,35 @@ LABEL name="Comet" \
|
|
| 4 |
description="Stremio's fastest torrent/debrid search add-on." \
|
| 5 |
url="https://github.com/g0ldyy/comet"
|
| 6 |
|
| 7 |
-
RUN addgroup -S myuser && adduser -S myuser -G myuser
|
| 8 |
-
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
|
| 12 |
-
COPY poetry.lock pyproject.toml ./
|
| 13 |
|
| 14 |
-
# Environment variables for Poetry setup
|
| 15 |
ENV PYTHONUNBUFFERED=1 \
|
| 16 |
PYTHONDONTWRITEBYTECODE=1 \
|
| 17 |
POETRY_NO_INTERACTION=1 \
|
| 18 |
POETRY_HOME="/usr/local" \
|
| 19 |
FORCE_COLOR=1 \
|
| 20 |
-
TERM=xterm-256color
|
| 21 |
-
POETRY_CACHE_DIR="/home/myuser/.cache/pypoetry"
|
| 22 |
-
|
| 23 |
-
# Install dependencies
|
| 24 |
-
RUN apk add --no-cache gcc musl-dev libffi-dev make
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
RUN
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Install Poetry
|
| 31 |
RUN pip install poetry
|
| 32 |
|
| 33 |
-
# Copy the
|
| 34 |
-
COPY
|
| 35 |
-
|
| 36 |
-
# Change the owner of the /app directory just in case
|
| 37 |
-
RUN chown -R myuser:myuser /app
|
| 38 |
|
| 39 |
-
#
|
| 40 |
-
|
| 41 |
|
| 42 |
-
# Now
|
| 43 |
-
|
| 44 |
|
| 45 |
-
#
|
| 46 |
ENTRYPOINT ["poetry", "run", "python", "-m", "comet.main"]
|
|
|
|
| 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 |
ENV PYTHONUNBUFFERED=1 \
|
| 12 |
PYTHONDONTWRITEBYTECODE=1 \
|
| 13 |
POETRY_NO_INTERACTION=1 \
|
| 14 |
POETRY_HOME="/usr/local" \
|
| 15 |
FORCE_COLOR=1 \
|
| 16 |
+
TERM=xterm-256color
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
# Install necessary packages for building
|
| 19 |
+
RUN apk add --no-cache \
|
| 20 |
+
gcc \
|
| 21 |
+
musl-dev \
|
| 22 |
+
libffi-dev \
|
| 23 |
+
make
|
| 24 |
|
| 25 |
# Install Poetry
|
| 26 |
RUN pip install poetry
|
| 27 |
|
| 28 |
+
# Copy only the necessary files first for dependency installation
|
| 29 |
+
COPY poetry.lock pyproject.toml ./
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
# Install dependencies using Poetry
|
| 32 |
+
RUN poetry install --no-cache --without dev
|
| 33 |
|
| 34 |
+
# Now, copy the rest of your application code
|
| 35 |
+
COPY . .
|
| 36 |
|
| 37 |
+
# Entrypoint to run the application
|
| 38 |
ENTRYPOINT ["poetry", "run", "python", "-m", "comet.main"]
|