Browse Source

add volume to support restarts

esell 1 year ago
parent
commit
5c1dcfc922
3 changed files with 9 additions and 5 deletions
  1. 5
    3
      Dockerfile
  2. 1
    2
      README.md
  3. 3
    0
      docker-compose.yml

+ 5
- 3
Dockerfile View File

@@ -1,9 +1,11 @@
1 1
 FROM golang:1.8-alpine
2 2
 
3
-COPY conf.json /go/bin/
3
+WORKDIR /go/src/app
4
+COPY . .
4 5
 
5
-RUN apk add --no-cache git && go get git.esheavyindustries.com/esell/hoptocopter
6
+RUN go-wrapper download
7
+RUN go-wrapper install
6 8
 
7
-CMD cd /go/bin && ./hoptocopter
9
+CMD ["go-wrapper", "run"]
8 10
 
9 11
 EXPOSE 8080

+ 1
- 2
README.md View File

@@ -31,6 +31,5 @@ Now all you need to do is POST your coverage output to hoptocopter:
31 31
 
32 32
 And when you want the badge? Just send a GET hoptocopter's way:
33 33
 
34
-`curl -XPOST 'http://localhost:8080/display?repo=deb-simple'"`
34
+`curl -XGET 'http://myserver.com:8080/display?repo=deb-simple'`
35 35
 
36
-**NOTE** The default compose file does NOT mount any volumes so your coverage results will be erased if the containers restart...

+ 3
- 0
docker-compose.yml View File

@@ -2,6 +2,9 @@ version: '2'
2 2
 
3 3
 services:
4 4
   hoptocopter:
5
+    volumes:
6
+        - .:/go/src/app
7
+    working_dir: /go/src/app
5 8
     build: .
6 9
     ports:
7 10
      - "8080:8080"