forked from gourouting/giligili
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (22 loc) · 646 Bytes
/
Dockerfile
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
FROM golang as build
ENV GOPROXY=https://goproxy.io
ADD . /giligili
WORKDIR /giligili
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o api_server
FROM alpine:3.7
ENV REDIS_ADDR=""
ENV REDIS_PW=""
ENV REDIS_DB=""
ENV MysqlDSN=""
ENV GIN_MODE="release"
ENV PORT=3000
RUN echo "http:https://mirrors.aliyun.com/alpine/v3.7/main/" > /etc/apk/repositories && \
apk update && \
apk add ca-certificates && \
echo "hosts: files dns" > /etc/nsswitch.conf && \
mkdir -p /www/conf
WORKDIR /www
COPY --from=build /giligili/api_server /usr/bin/api_server
ADD ./conf /www/conf
RUN chmod +x /usr/bin/api_server
ENTRYPOINT ["api_server"]