Maouu commited on
Commit
5fa9081
·
verified ·
1 Parent(s): 2197439

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -12
Dockerfile CHANGED
@@ -2,34 +2,36 @@ FROM python:3.9-slim
2
 
3
  # System dependencies
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- build-essential gcc libffi-dev libpq-dev curl && \
6
  apt-get clean && rm -rf /var/lib/apt/lists/*
7
 
8
- # Set workdir
9
- WORKDIR /app
 
 
 
10
 
11
- # Copy requirements and install
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir --upgrade pip && \
14
  pip install --no-cache-dir -r requirements.txt
15
 
16
- # Copy app code
17
- COPY . .
 
 
18
 
19
- # Create logs.json with correct permissions
20
  RUN touch logs.json && \
21
  chown 1000:1000 logs.json && \
22
  chmod 664 logs.json
23
 
24
- # Create and switch to non-root user
25
  RUN useradd -m -u 1000 user
26
  USER user
27
-
28
- # Set environment
29
  ENV PATH="/home/user/.local/bin:$PATH"
30
 
31
- # Expose port
32
  EXPOSE 7860
33
 
34
- # Start app with uvicorn
35
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"]
 
2
 
3
  # System dependencies
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ build-essential gcc libffi-dev libpq-dev curl gnupg ca-certificates && \
6
  apt-get clean && rm -rf /var/lib/apt/lists/*
7
 
8
+ # ---------- Install Node.js ----------
9
+ # Add NodeSource APT repo
10
+ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
11
+ apt-get install -y nodejs && \
12
+ node -v && npm -v
13
 
14
+ # ---------- Python Setup ----------
15
+ WORKDIR /app
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir --upgrade pip && \
18
  pip install --no-cache-dir -r requirements.txt
19
 
20
+ # ---------- Node.js Setup ----------
21
+ # Copy JS files (adjust if needed)
22
+ COPY test.js ./
23
+ RUN npm install youtube-po-token-generator
24
 
25
+ # ---------- Logging and User Setup ----------
26
  RUN touch logs.json && \
27
  chown 1000:1000 logs.json && \
28
  chmod 664 logs.json
29
 
 
30
  RUN useradd -m -u 1000 user
31
  USER user
 
 
32
  ENV PATH="/home/user/.local/bin:$PATH"
33
 
 
34
  EXPOSE 7860
35
 
36
+ # ---------- Run Uvicorn ----------
37
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"]