forked from BryanSLam/discord-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.runbot
39 lines (32 loc) · 1.12 KB
/
Dockerfile.runbot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM golang:1.13.12-alpine3.12
# Install bash shell
RUN apk update
RUN apk upgrade
RUN apk add bash
RUN apk add bash-completion
RUN apk add build-base
# Dev tools
RUN apk add autoconf automake libtool gcc make
# Install tools required to build project
# We will need to run `docker build --no-cache .` to update those dependencies
RUN apk add --no-cache git
# Install ffmpeg to strip audio stream from mp4
RUN apk add --no-cache ffmpeg
# Install opus codec for mp3 playback
RUN git clone https://gitlab.xiph.org/xiph/opus.git
RUN cd ./opus && ./autogen.sh
RUN cd ./opus && ./configure
RUN cd ./opus && make
RUN cd ./opus && make install
# go.mod and go.sum lists project dependencies
# These layers will only be re-built when Gopkg files are updated
COPY go.mod go.sum /go/src/discord-bot/
WORKDIR /go/src/discord-bot/
# Install library dependencies
ENV GO111MODULE=on
RUN go mod vendor
# Copy all project and build it
# This layer will be rebuilt when ever a file has changed in the project directory
COPY . /go/src/discord-bot/
RUN go build -o cmd/discord-bot/discord-bot cmd/discord-bot/main.go
CMD ["./cmd/discord-bot/discord-bot"]