-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
WangWengang
committed
Apr 28, 2023
1 parent
6da9b7a
commit b8d572a
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM golang:alpine as builder | ||
|
||
WORKDIR /go/src/douyin | ||
COPY . . | ||
|
||
RUN go env -w GO111MODULE=on \ | ||
&& go env -w GOPROXY=https://goproxy.cn,direct \ | ||
&& go env -w CGO_ENABLED=0 \ | ||
&& go env \ | ||
&& go mod tidy \ | ||
&& go build -o server . | ||
|
||
FROM alpine:latest | ||
LABEL MAINTAINER="wwwwangg@163.com" | ||
|
||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories | ||
|
||
RUN apk add --no-cache gettext tzdata curl && \ | ||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ | ||
echo "Asia/Shanghai" > /etc/timezone && \ | ||
date && \ | ||
apk del tzdata | ||
|
||
|
||
WORKDIR /go/src/server | ||
COPY --from=0 /go/src/douyin/server ./ | ||
COPY --from=0 /go/src/douyin/certificates ./certificates | ||
|
||
RUN cp ./certificates/proxy-ca.crt /usr/local/share/ca-certificates/proxy-ca.crt | ||
RUN update-ca-certificates | ||
|
||
EXPOSE 8001 | ||
ENTRYPOINT ./server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: "3" | ||
|
||
services: | ||
proxy: | ||
build: | ||
context: ../../douyin | ||
dockerfile: ./Dockerfile | ||
container_name: douyin-proxy | ||
restart: always | ||
ports: | ||
- '8001:8001' | ||
- '8888:8888' |