mikmc commited on
Commit
a716ac9
·
verified ·
1 Parent(s): 729f0ef

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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
- # Copying only the build files first
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
- # Create cache directory for Poetry
27
- RUN mkdir -p /home/myuser/.cache/pypoetry && \
28
- chown -R myuser:myuser /home/myuser/.cache/pypoetry
 
 
 
29
 
30
  # Install Poetry
31
  RUN pip install poetry
32
 
33
- # Copy the application code
34
- COPY --chown=myuser:myuser . .
35
-
36
- # Change the owner of the /app directory just in case
37
- RUN chown -R myuser:myuser /app
38
 
39
- # Switch to the non-root user
40
- USER myuser
41
 
42
- # Now install dependencies
43
- RUN poetry install --no-cache --no-root --without dev
44
 
45
- # Set entry point of the application
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"]