add docker file

This commit is contained in:
sentriz
2019-07-16 15:42:45 +01:00
parent 0fab58486d
commit fced0acd2b
2 changed files with 23 additions and 0 deletions

8
.dockerignore Normal file
View File

@@ -0,0 +1,8 @@
.git
.github
.gitignore
.golangci.yml
*testdata*
*_test.go
*.db
README.md

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM golang:1.12-alpine AS builder
WORKDIR /src
COPY . .
RUN \
apk add taglib-dev sqlite build-base git && \
./_do_build_server && \
./_do_build_scanner && \
apk del build-base && \
mv ./gonic ./gonicscan /bin/
VOLUME ["/data", "/music"]
EXPOSE 80
ENV GONIC_LISTEN_ADDR :80
ENV GONIC_DB_PATH /data/gonic.db
ENV GONIC_MUSIC_PATH /music
CMD ["gonic"]