Spaces:
Runtime error

Riaz485 commited on
Commit
533eccd
·
verified ·
1 Parent(s): 8340747

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -12
Dockerfile CHANGED
@@ -1,19 +1,25 @@
1
- # 1. Multi-stage build ka pehla step: Alpine Linux mein code clone karna
2
- FROM alpine:latest AS cloner
3
- RUN apk add --no-cache git
4
- WORKDIR /repo
5
- RUN git clone https://github.com/riaz472/analytics.git .
6
 
7
- # 2. Main step: Jo asli Dockerfile aap ki repository ke andar hai, yeh usko utha lega
8
- FROM alpine:latest
9
  WORKDIR /app
10
- COPY --from=cloner /repo /app
11
 
12
- # 3. Hugging Face ko batana ke port 7860 use kare
 
 
 
 
 
 
 
 
 
13
  EXPOSE 7860
14
  ENV PORT=7860
 
15
 
16
- # 4. Agar aap ke project ki apni asli Dockerfile sahi set hai, toh hum direct entrypoint run kar sakte hain
17
- # Lekin safe side ke liye, aap mujhe aik dafa bata dein ke aap ki repo ke andar jo asli Dockerfile hai, uska CMD kya hai?
18
- # Abhi ke liye hum generic command de rahe hain:
19
  CMD ["mix", "phx.server"]
 
1
+ # 1. Elixir aur Alpine Linux ka official image use karenge taake "mix" command mil jaye
2
+ FROM elixir:1.15-alpine
3
+
4
+ # 2. Git aur build tools install karenge taake clone smooth ho
5
+ RUN apk add --no-cache git build-base
6
 
7
+ # 3. Working directory set karenge
 
8
  WORKDIR /app
 
9
 
10
+ # 4. GitHub se aap ka fresh code clone karenge
11
+ RUN git clone https://github.com/riaz472/analytics.git .
12
+
13
+ # 5. Elixir ke tools aur dependencies ko install/compile karenge
14
+ RUN mix local.hex --force && \
15
+ mix local.rebar --force
16
+
17
+ RUN mix deps.get && mix deps.compile
18
+
19
+ # 6. Hugging Face ki required port aur environment variables
20
  EXPOSE 7860
21
  ENV PORT=7860
22
+ ENV MIX_ENV=prod
23
 
24
+ # 7. Server ko start karne ki final command
 
 
25
  CMD ["mix", "phx.server"]