Update Dockerfile
Browse files- Dockerfile +5 -14
Dockerfile
CHANGED
|
@@ -1,31 +1,22 @@
|
|
| 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 |
-
#
|
| 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 |
-
#
|
| 31 |
CMD ["sh", "-c", "snowflake-proxy -verbose -relay https://snowflake.torproject.org/ & uvicorn app:app --host 0.0.0.0 --port 7860"]
|
|
|
|
| 1 |
FROM golang:1.24 AS builder
|
|
|
|
|
|
|
| 2 |
RUN go install gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/cmd/snowflake-proxy@latest
|
| 3 |
|
| 4 |
FROM ubuntu:22.04
|
| 5 |
|
| 6 |
+
# Minimal dependencies only
|
| 7 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
ca-certificates \
|
|
|
|
| 9 |
python3 \
|
| 10 |
python3-pip \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 12 |
+
&& pip3 install --no-cache-dir fastapi uvicorn
|
| 13 |
|
|
|
|
| 14 |
COPY --from=builder /go/bin/snowflake-proxy /usr/local/bin/
|
| 15 |
|
| 16 |
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
COPY app.py .
|
| 18 |
|
| 19 |
EXPOSE 7860
|
| 20 |
|
| 21 |
+
# Start snowflake in background + FastAPI in foreground
|
| 22 |
CMD ["sh", "-c", "snowflake-proxy -verbose -relay https://snowflake.torproject.org/ & uvicorn app:app --host 0.0.0.0 --port 7860"]
|