Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
codekoala committed Jul 31, 2017
1 parent f7621f0 commit 1ba7874
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
language: go
sudo: required
services:
- docker

go:
- 1.7.x
- 1.8.x
- release

install:
- curl https://glide.sh/get | sh
Expand All @@ -19,3 +21,13 @@ deploy:
on:
repo: codekoala/go-treksum
tags: true

after_success:
- make docker
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker push codekoala/treksum:latest;
fi
- if [ "$TRAVIS_TAG" != "" ]; then
docker push codekoala/treksum:$TRAVIS_TAG;
fi
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:16.04
MAINTAINER Josh VanderLinden <[email protected]>

COPY ./bin/treksum-api /usr/bin/treksum-api

EXPOSE 1323
CMD ["/usr/bin/treksum-api"]
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ checksums:

clean:
rm -rf ./bin

docker:
docker build -t codekoala/treksum .
5 changes: 3 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ func Connect() (*pgx.ConnPool, error) {
ConnConfig: pgx.ConnConfig{
Host: config.Global.DbHost,
Port: config.Global.DbPort,
Database: config.Global.DbUser,
User: config.Global.DbPassword,
Database: config.Global.DbName,
User: config.Global.DbUser,
Password: config.Global.DbPassword,
},
MaxConnections: 20,
})
Expand Down

0 comments on commit 1ba7874

Please sign in to comment.