| FROM golang:1.24 AS builder |
|
|
| RUN git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git /snowflake && \ |
| cd /snowflake && \ |
| echo "=== Directory listing ===" && \ |
| ls -la && \ |
| echo "=== CMD folder ===" && \ |
| ls -la cmd/ 2>/dev/null || echo "No cmd folder" && \ |
| echo "=== Looking for main packages ===" && \ |
| find . -name "main.go" | head -10 && \ |
| echo "=== Building... ===" && \ |
| go build -o /usr/local/bin/snowflake-proxy ./cmd/snowflake-proxy || \ |
| go build -o /usr/local/bin/snowflake-proxy ./cmd/proxy || \ |
| go build -o /usr/local/bin/snowflake-proxy ./proxy || \ |
| echo "Build failed - no main found" |
|
|
| FROM ubuntu:22.04 |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| ca-certificates \ |
| python3 \ |
| python3-pip \ |
| && rm -rf /var/lib/apt/lists/* \ |
| && pip3 install --no-cache-dir fastapi uvicorn |
|
|
| COPY --from=builder /usr/local/bin/snowflake-proxy /usr/local/bin/ |
|
|
| WORKDIR /app |
| COPY app.py . |
|
|
| EXPOSE 7860 |
|
|
| CMD ["sh", "-c", "snowflake-proxy -verbose -relay https://snowflake.torproject.org/ & uvicorn app:app --host 0.0.0.0 --port 7860"] |