Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Jul 12, 2018
1 parent 7354478 commit 5e3f978
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.dockerignore
Dockerfile
vendor/
cve.sqlite3
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM golang:alpine as builder

RUN apk --no-cache add git

ENV REPOSITORY github.com/usiusi360/vulsrepo

COPY . $GOPATH/src/$REPOSITORY
RUN cd $GOPATH/src/$REPOSITORY/server \
&& go get -u github.com/golang/dep/... \
&& dep ensure \
&& go build -ldflags "-s -w" -o $GOPATH/bin/vulsrepo-server

RUN mkdir /vulsrepo \
&& mv $GOPATH/src/$REPOSITORY/server/vulsrepo-config.toml.sample /vulsrepo/vulsrepo-config.toml \
&& mv $GOPATH/src/$REPOSITORY /vulsrepo/www \
&& rm -rf /vulsrepo/www/.git* /vulsrepo/www/server \
&& sed -i -e 's/vulsrepo/www/g' /vulsrepo/vulsrepo-config.toml \
&& sed -i -e 's/home\/vuls-user/vulsrepo/g' /vulsrepo/vulsrepo-config.toml \
&& sed -i -e 's/\/opt//g' /vulsrepo/vulsrepo-config.toml

FROM alpine:3.7

MAINTAINER hikachan sadayuki-matsuno usiusi360

COPY --from=builder /go/bin/vulsrepo-server /usr/local/bin/
COPY --from=builder /vulsrepo /vulsrepo

VOLUME /vuls
WORKDIR /vulsrepo

EXPOSE 5111
CMD ["vulsrepo-server"]

0 comments on commit 5e3f978

Please sign in to comment.