diff --git a/Dockerfile.bot b/Dockerfile.bot new file mode 100644 index 0000000..ece0c9b --- /dev/null +++ b/Dockerfile.bot @@ -0,0 +1,16 @@ +FROM golang:1.20 as builder +WORKDIR /src +COPY . . +RUN apt-get update && apt-get -y install libopus-dev libopusfile-dev && \ + go build + +FROM debian:bullseye-slim +RUN apt-get update && apt-get -y install \ + ca-certificates \ + libopus-dev libopusfile-dev \ + mpd + +COPY --from=builder /src/dndmusicbot /app/ +ADD tmpl /app/tmpl +WORKDIR /app +ENTRYPOINT [ "/app/dndmusicbot" ] diff --git a/Dockerfile.bot.dockerignore b/Dockerfile.bot.dockerignore new file mode 100644 index 0000000..c1ca5b3 --- /dev/null +++ b/Dockerfile.bot.dockerignore @@ -0,0 +1,16 @@ +ambiance +bin +cache +config +cookies.txt +dndmusicbot +Dockerfile +.git +.gitignore +.dockerignore +.jsimage +k8s +MPD +oauth.cfg +test +src diff --git a/Dockerfile b/Dockerfile.js similarity index 90% rename from Dockerfile rename to Dockerfile.js index 3c3bb5c..e406a65 100644 --- a/Dockerfile +++ b/Dockerfile.js @@ -6,4 +6,4 @@ RUN mkdir /public && chmod 777 /public WORKDIR /app -ENTRYPOINT ["yarn"] +ENTRYPOINT ["yarn"] \ No newline at end of file diff --git a/Dockerfile.js.dockerignore b/Dockerfile.js.dockerignore new file mode 100644 index 0000000..8218af2 --- /dev/null +++ b/Dockerfile.js.dockerignore @@ -0,0 +1,2 @@ +ambiance +*.mp3 diff --git a/Makefile b/Makefile index 8995593..2e9bdd4 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,9 @@ js: image public/script.js image: .jsimage -.jsimage: Dockerfile - @docker build -t dndmusicbot-js-build . +.jsimage: export DOCKER_BUILDKIT=1 +.jsimage: Dockerfile.js + @docker build -t dndmusicbot-js-build . -f Dockerfile.js @touch .jsimage src/node_modules: