mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
23 lines
707 B
Docker
23 lines
707 B
Docker
FROM golang:alpine AS builder
|
|
WORKDIR /
|
|
RUN apk add --update git &&\
|
|
git clone --depth=1 https://github.com/p4gefau1t/trojan-go.git &&\
|
|
cd trojan-go && mkdir release && go build -tags "full" -ldflags "-s -w" -o release &&\
|
|
wget https://github.com/v2ray/domain-list-community/raw/release/dlc.dat -O release/geosite.dat &&\
|
|
wget https://github.com/v2ray/geoip/raw/release/geoip.dat -O release/geoip.dat
|
|
|
|
FROM alpine
|
|
WORKDIR /
|
|
COPY --from=builder /trojan-go/release /usr/local/bin/
|
|
COPY example/server.json /etc/trojan-go/config.json
|
|
|
|
RUN set -ex \
|
|
&& apk add --no-cache \
|
|
tzdata
|
|
ENV TZ=Asia/Shanghai
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/trojan-go", "-config"]
|
|
CMD ["/etc/trojan-go/server.json"]
|
|
|