mnpx commited on
Commit
3976f84
·
verified ·
1 Parent(s): 94a57c8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -1,25 +1,31 @@
1
- FROM golang:1.21 AS builder
2
 
3
- # Install snowflake
4
  RUN go install gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/cmd/snowflake-proxy@latest
5
 
6
  FROM ubuntu:22.04
7
 
 
8
  RUN apt-get update && apt-get install -y \
9
- curl \
10
  ca-certificates \
 
 
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
 
13
  COPY --from=builder /go/bin/snowflake-proxy /usr/local/bin/
14
 
15
- # For the dashboard
16
- RUN apt-get update && apt-get install -y python3 python3-pip
17
- RUN pip3 install fastapi uvicorn
18
-
19
  WORKDIR /app
 
 
 
 
 
 
20
  COPY app.py .
21
 
22
- # Expose the web port
23
  EXPOSE 7860
24
 
25
- CMD ["sh", "-c", "snowflake-proxy -verbose -relay https://snowflake.torproject.org/ & python3 app.py"]
 
 
1
+ FROM golang:1.24 AS builder
2
 
3
+ # Build snowflake proxy
4
  RUN go install gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/cmd/snowflake-proxy@latest
5
 
6
  FROM ubuntu:22.04
7
 
8
+ # Install dependencies
9
  RUN apt-get update && apt-get install -y \
 
10
  ca-certificates \
11
+ curl \
12
+ python3 \
13
+ python3-pip \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
+ # Copy snowflake binary from builder
17
  COPY --from=builder /go/bin/snowflake-proxy /usr/local/bin/
18
 
 
 
 
 
19
  WORKDIR /app
20
+
21
+ # Install Python dependencies
22
+ COPY requirements.txt .
23
+ RUN pip3 install --no-cache-dir -r requirements.txt
24
+
25
+ # Copy app
26
  COPY app.py .
27
 
 
28
  EXPOSE 7860
29
 
30
+ # Run snowflake in background + web server in foreground
31
+ CMD ["sh", "-c", "snowflake-proxy -verbose -relay https://snowflake.torproject.org/ & uvicorn app:app --host 0.0.0.0 --port 7860"]