Skip to content

Commit

Permalink
feat: dockerize bot (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Sep 12, 2018
1 parent c22e77c commit 448e55d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .dockerignore
Expand Up @@ -2,3 +2,9 @@
client/
node_modules/
gin-bin
!client/go
Dockerfile
*~
*#
.#*
*.md
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -8,7 +8,7 @@ RUN cd core && make _ci_prepare # touching generated files
RUN cd core && make install

# minimal runtime
FROM alpine
FROM alpine:3.8
RUN apk --no-cache --update add openssl
COPY --from=core-builder /go/bin/berty /bin/berty
ENTRYPOINT ["/bin/berty"]
Expand Down
9 changes: 9 additions & 0 deletions client/go/bot/examples/berty-bot-example/Dockerfile
@@ -0,0 +1,9 @@
FROM golang:1.11-alpine as builder
RUN apk --no-cache --update add nodejs-npm make gcc g++ musl-dev openssl-dev
COPY . /go/src/berty.tech/
WORKDIR /go/src/berty.tech/client/go/bot/examples/berty-bot-example/
RUN go install -i

FROM alpine:3.8
COPY --from=builder /go/bin/berty-bot-example /bin/berty-bot-example
ENTRYPOINT ["/bin/berty-bot-example"]
16 changes: 16 additions & 0 deletions client/go/bot/examples/berty-bot-example/docker-compose.yml
@@ -0,0 +1,16 @@
version: "3"

services:
daemon:
build: ../../../../..
command: daemon --log-level=debug
ports:
- 1337
network_mode: host
bot:
build:
context: ../../../../..
dockerfile: ./client/go/bot/examples/berty-bot-example/Dockerfile
network_mode: host
depends_on:
- daemon

0 comments on commit 448e55d

Please sign in to comment.