NOT-OMEGA commited on
Commit
e89c645
Β·
verified Β·
1 Parent(s): fce5820

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -0
Dockerfile ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ # ── System deps ────────────────────────────────────────────────────────────
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ g++ make libgomp1 libgomp-10-dev \
7
+ python3 python3-pip python3-dev \
8
+ curl ca-certificates \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # ── Python deps ────────────────────────────────────────────────────────────
12
+ WORKDIR /app
13
+ COPY requirements.txt .
14
+ RUN pip3 install --no-cache-dir -r requirements.txt
15
+
16
+ # ── Copy source and compile C++ inference binary ───────────────────────────
17
+ COPY llama_inference.cpp .
18
+ RUN g++ -O3 -march=native -fopenmp \
19
+ -o llama_inference llama_inference.cpp -lm \
20
+ && chmod +x llama_inference \
21
+ && echo "[OK] llama_inference compiled"
22
+
23
+ # ── Copy app files ─────────────────────────────────────────────────────────
24
+ COPY server.py .
25
+ COPY index.html .
26
+
27
+ # ── HF Spaces runs as non-root user 1000 ──────────────────────────────────
28
+ RUN useradd -m -u 1000 user
29
+ RUN mkdir -p /app/models && chown -R user:user /app
30
+ USER user
31
+
32
+ # HF Spaces requires port 7860
33
+ EXPOSE 7860
34
+
35
+ # Model repo β€” override via Space secret if needed
36
+ ENV HF_MODEL_REPO="NOT-OMEGA/LLaMA"
37
+ ENV PORT=7860
38
+
39
+ CMD ["python3", "server.py"]