File size: 844 Bytes
776f89e
4bfd745
 
 
776f89e
 
 
 
 
 
 
 
4bfd745
 
776f89e
4bfd745
 
 
 
776f89e
 
 
 
 
 
 
 
 
4597f89
776f89e
 
 
4bfd745
776f89e
4bfd745
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM golang:1.20-alpine3.19

LABEL creator="qywok"

ENV APP_DIR=/tebakaja_proxy \
    GO111MODULE=on \
    CGO_ENABLED=0 \
    DOTENV=.env \
    HOST=0.0.0.0 \
    PORT=7860

WORKDIR ${APP_DIR}

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN go build -o main . && \
    go clean -modcache && \
    rm -rf /var/cache/apk/* \
      /root/.cache/go-build /root/go/pkg

RUN cat > ${DOTENV} <<EOF
TEBAKAJA_PROXY_HOST=${HOST}
TEBAKAJA_PROXY_PORT=${PORT}

TEBAKAJA_CORS_ALLOW_ORIGINS=https://huggingface.co,https://qywok-tebakaja-proxy-space-0.hf.space,https://qywok-tebakaja-proxy-space-1.hf.space,https://qywok-tebakaja-proxy-space-2.hf.space,https://qywok-tebakaja-proxy-space-3.hf.space,https://qywok-tebakaja-proxy-space-4.hf.space
TEBAKAJA_CORS_ALLOW_HEADERS=*
TEBAKAJA_CORS_ALLOW_METHODS=GET,POST
EOF

EXPOSE ${PORT}

CMD ["./main"]