Skip to content

Commit 56ef5a4

Browse files
committed
Add Dockerfile
1 parent ed451c5 commit 56ef5a4

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM golang:alpine
2+
3+
RUN mkdir -p /go/src/github.com/dunglas/stack2slack
4+
WORKDIR /go/src/github.com/dunglas/stack2slack
5+
ADD . /go/src/github.com/dunglas/stack2slack
6+
7+
RUN apk add --no-cache --virtual .build-deps git \
8+
&& go get \
9+
&& go install \
10+
&& apk del .build-deps \
11+
&& rm -rf /go/pkg \
12+
&& rm -rf /go/src \
13+
&& rm -rf /go/cache/apk/*
14+
15+
ENTRYPOINT ["/go/bin/stack2slack"]

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,23 @@ in a dedicated channel of the Slack of [Les-Tilleuls.coop](https://les-tilleuls.
88

99
[![Go Report Card](https://goreportcard.com/badge/github.com/dunglas/stack2slack)](https://goreportcard.com/report/github.com/dunglas/stack2slack)
1010
[![Build Status](https://travis-ci.org/dunglas/stack2slack.svg?branch=master)](https://travis-ci.org/dunglas/stack2slack)
11+
[![Docker Automated build](https://img.shields.io/docker/automated/dunglas/stack2slack.svg)](https://hub.docker.com/r/dunglas/stack2slack/)
1112

1213
## Installing
1314

14-
This bot is written in [Go](https://golang.org/) (golang), you need a proper install of Go to compile it from sources.
15+
The easiest way to get started is to use the official [Docker](https://www.docker.com/) image:
1516

16-
1. [Create new Slack bot](https://my.slack.com/services/new/bot) and grab the generated API token
17-
2. Clone this repository: `git clone https://github.com/dunglas/stack2slack.git`
18-
3. Get the dependencies `go get`
19-
4. Compile the app: `go build`
20-
5. Start the daemon: `DEBUG=1 SLACK_API_TOKEN=<your-API-token> TAG_TO_CHANNEL='{"stackoverflow-tag": "slack-channel"}' ./stack2slack`
21-
6. Finally, you need to invite the bot in channels it will post: `/invite @bot-name`
17+
1. [Register a new Slack bot](https://my.slack.com/services/new/bot) and grab the generated API token
18+
2. Start the daemon: `docker run -e DEBUG=1 -e SLACK_API_TOKEN=<your-API-token> -e TAG_TO_CHANNEL='{"stackoverflow-tag": "slack-channel"}' dunglas/stack2slack`
19+
6. Finally, invite the bot in channels it will post: `/invite @bot-name`
20+
21+
## Building from Sources
22+
23+
This bot is written in [Go](https://golang.org/) (golang), you need a proper install of it to compile the sources.
24+
25+
1. Clone this repository: `git clone https://github.com/dunglas/stack2slack.git`
26+
2. Get the dependencies `go get`
27+
3. Compile the app: `go build`
2228

2329
## Credits
2430

0 commit comments

Comments
 (0)