-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (34 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
44 lines (34 loc) · 1.17 KB
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
40
41
42
43
44
FROM node:9.5.0 as builder
ARG GOVERSION=1.17.5
ARG VERSION=v0.2.3
# Install golang and set GOPATH
RUN cd /tmp/ && \
wget https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go${GOVERSION}.linux-amd64.tar.gz && \
export PATH=$PATH:/usr/local/go/bin && export GOPATH=/go && \
go get -d github.com/restanrm/bell && \
go install github.com/rakyll/statik@latest
# Build front assets
RUN \
cd /go/pkg/mod/github.com/restanrm/bell@$VERSION/front && \
npm install && \
npm run build
RUN \
cd /go/pkg/mod/github.com/restanrm/bell@$VERSION && \
/go/bin/statik -src=./front/dist && \
export PATH=$PATH:/usr/local/go/bin:/go/bin && export GOPATH=/go && \
go generate && \
go get ./... && \
go install ./...
FROM ubuntu:20.04
RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install \
alsa-base alsa-utils pulseaudio \
flite mpv
WORKDIR /data
VOLUME /data
COPY --from=builder /go/bin/bell /usr/local/bin/bell
COPY --from=builder /go/bin/bellctl /usr/local/bin/bellctl
COPY data/store.json /data/store.json
COPY data/sounds /data/sounds
EXPOSE 10101
CMD ["bell","-d","/data"]