Proff12 commited on
Commit
6c671a5
·
verified ·
1 Parent(s): 716cac1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -3
Dockerfile CHANGED
@@ -1,4 +1,3 @@
1
-
2
  # --- Stage 1: Build React frontend ---
3
  FROM node:20-alpine AS frontend
4
  WORKDIR /app/frontend
@@ -15,9 +14,14 @@ FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 AS backend
15
  ENV DEBIAN_FRONTEND=noninteractive PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1
16
 
17
  ENV HF_HOME=/app/.cache/huggingface
18
- ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/transformers
19
 
20
- RUN mkdir -p /app/.cache/huggingface
 
 
 
 
 
 
21
  # Install Python and system deps
22
  RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-venv git && rm -rf /var/lib/apt/lists/*
23
 
 
 
1
  # --- Stage 1: Build React frontend ---
2
  FROM node:20-alpine AS frontend
3
  WORKDIR /app/frontend
 
14
  ENV DEBIAN_FRONTEND=noninteractive PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1
15
 
16
  ENV HF_HOME=/app/.cache/huggingface
 
17
 
18
+ RUN useradd -m appuser
19
+ # Create cache directory and set permissions before switching
20
+ RUN mkdir -p /app/.cache/huggingface/transformers && \
21
+ chown -R appuser:appuser /app/.cache
22
+
23
+ # Switch to non-root user
24
+ USER appuser
25
  # Install Python and system deps
26
  RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-venv git && rm -rf /var/lib/apt/lists/*
27