gofound/Dockerfile

31 lines
502 B
Docker

FROM golang:1.19-alpine as builder
ENV GO111MODULE=on \
GOPROXY=https://goproxy.io
COPY . /app
WORKDIR /app
RUN go get && go build -ldflags="-s -w" -o gofound .
FROM harbor.ks.easyj.top/zt/alpine:0.1
LABEL "authors"="suguo.yao"
LABEL "email"="ysg@myschools.me"
ENV APP_DIR=/app \
addr=0.0.0.0 \
port=5678 \
data="/data/gofound" \
dictionary="/data/gofound"
COPY --from=builder /app/gofound ${APP_DIR}/gofound
WORKDIR ${APP_DIR}
EXPOSE 5678
RUN chmod +x gofound
CMD ["./gofound"]