Skip to content

Commit

Permalink
Merge pull request #38 from MattMasters/docker-build
Browse files Browse the repository at this point in the history
build and run with docker
  • Loading branch information
brandur-stripe authored Dec 22, 2017
2 parents 9d064de + 8834f26 commit 17c2761
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ go:
# magic word to use faster/newer container-based architecture
sudo: false

services:
- docker

before_install:
- go get -u github.com/golang/lint/golint
- go get -u github.com/jteeuwen/go-bindata/...
Expand All @@ -16,6 +19,12 @@ script:
- make vet
- scripts/check_gofmt.sh

# Build and test the Docker image
- docker build -t stripe-mock .
- docker run -d --name stripe-mock -p 12111:12111 stripe-mock
- docker ps -a
- docker exec -it stripe-mock /bin/sh -c "cd /go/src/github.com/stripe/stripe-mock/; go test ./..."

notifications:
email:
on_success: never
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:1.9-alpine

ADD . /go/src/github.com/stripe/stripe-mock

RUN go install github.com/stripe/stripe-mock

EXPOSE 12111

ENTRYPOINT /go/bin/stripe-mock
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ Run it:
stripe-mock
```

Or with docker:
``` sh
# build
docker build . -t stripe-mock
# run
docker run -p 12111:12111 stripe-mock
```

Then from another terminal:

``` sh
Expand Down

0 comments on commit 17c2761

Please sign in to comment.