-
Notifications
You must be signed in to change notification settings - Fork 546
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
1 parent
876b8cf
commit bd7666b
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,7 +1,13 @@ | ||
FROM golang:latest | ||
RUN mkdir /app | ||
WORKDIR /app | ||
ENV SRC_DIR=/go/src/github.com/codeskyblue/gohttpserver | ||
ADD . $SRC_DIR | ||
RUN cd $SRC_DIR; go build; cp gohttpserver /app/ | ||
ENTRYPOINT ["/app/gohttpserver"] | ||
FROM golang:1.9 AS build | ||
WORKDIR /go/src/github.com/codeskyblue/gohttpserver | ||
ADD . /go/src/github.com/codeskyblue/gohttpserver/ | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gohttpserver . | ||
|
||
FROM alpine:3.6 | ||
WORKDIR /app | ||
RUN mkdir -p /app/public | ||
VOLUME /app/public | ||
ADD res ./res | ||
COPY --from=build /go/src/github.com/codeskyblue/gohttpserver/gohttpserver . | ||
EXPOSE 8000 | ||
CMD ["/app/gohttpserver", "--root=/app/public"] |