mikmc commited on
Commit
ea4389c
·
verified ·
1 Parent(s): 82fc6e1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -18
Dockerfile CHANGED
@@ -1,11 +1,14 @@
1
- FROM python:3.11-alpine
 
2
  LABEL name="Comet" \
3
  description="Stremio's fastest torrent/debrid search add-on." \
4
- url="https://github.com/g0ldyy/comet"
 
 
5
 
6
- WORKDIR /app
7
 
8
- ARG DATABASE_PATH
9
 
10
  ENV PYTHONUNBUFFERED=1 \
11
  PYTHONDONTWRITEBYTECODE=1 \
@@ -13,21 +16,18 @@ ENV PYTHONUNBUFFERED=1 \
13
  POETRY_HOME="/usr/local" \
14
  FORCE_COLOR=1 \
15
  TERM=xterm-256color \
16
- POETRY_CACHE_DIR="/root/.cache/pypoetry"
 
 
 
 
 
 
17
 
18
- # Fix python-alpine gcc
19
- RUN apk add --no-cache \
20
- gcc \
21
- musl-dev \
22
- libffi-dev \
23
- make
24
 
25
- # Create a writable directory for poetry cache
26
- RUN mkdir -p /root/.cache/pypoetry && \
27
- chown -R root:root /root/.cache/pypoetry
28
 
29
- RUN pip install poetry
30
- COPY . .
31
- RUN poetry install --no-cache --no-root --without dev
32
 
33
- ENTRYPOINT ["poetry", "run", "python", "-m", "comet.main"]
 
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
+ RUN addgroup -S myuser && adduser -S myuser -G myuser
8
 
9
+ WORKDIR /app
10
 
11
+ ARG DATABASE_PATH
12
 
13
  ENV PYTHONUNBUFFERED=1 \
14
  PYTHONDONTWRITEBYTECODE=1 \
 
16
  POETRY_HOME="/usr/local" \
17
  FORCE_COLOR=1 \
18
  TERM=xterm-256color \
19
+ POETRY_CACHE_DIR="/home/myuser/.cache/pypoetry"
20
+
21
+ RUN apk add --no-cache gcc musl-dev libffi-dev make
22
+
23
+ RUN mkdir -p /home/myuser/.cache/pypoetry && chown -R myuser:myuser /home/myuser/.cache/pypoetry
24
+
25
+ RUN pip install poetry
26
 
27
+ COPY . .
 
 
 
 
 
28
 
29
+ USER myuser
 
 
30
 
31
+ RUN poetry install --no-cache --no-root --without dev
 
 
32
 
33
+ ENTRYPOINT ["poetry", "run", "python", "-m", "comet.main"]