New Dockerfile and Travis Config (#23)

This commit is contained in:
terorie 2019-02-22 05:07:27 +01:00 committed by GitHub
parent 281d2d17d6
commit 9f1402e841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 4 deletions

View File

@ -1,5 +1,13 @@
language: go
sudo: required
go:
- "1.11.x"
- master
services:
- docker
script:
- docker build -t terorie/od-database-crawler .
after_success:
- if [[ "$TRAVIS_BRANCH" == "stable" ]]; then
docker login -u terorie -p $DOCKER_PASSWORD ;
docker push terorie/od-database-crawler ;
fi

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM golang:1.11.5 AS builder
ADD . /src
RUN cd /src \
&& go test . \
&& go build -o binary
FROM alpine
WORKDIR /app
COPY --from=builder /src/binary /app/
ENTRYPOINT ./binary