move everything into public instead of src/public
parent
da00ab1b66
commit
8727594413
|
@ -2,8 +2,8 @@
|
|||
# docker run -it -v $(pwd)/public:/app/public dndmusicbot-js-build
|
||||
FROM node:19-alpine3.16
|
||||
|
||||
RUN mkdir /public && chmod 777 /public
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN yarn
|
||||
|
||||
ENTRYPOINT ["yarn"]
|
||||
|
|
17
Makefile
17
Makefile
|
@ -2,10 +2,11 @@
|
|||
APPLICATION_NAME ?= dndmusicbot
|
||||
CURRENT_UID := $(shell id -u)
|
||||
BIN := src/node_modules/.bin
|
||||
YARN = docker run --rm --user $(CURRENT_UID) -v $(CURDIR)/src:/app -v $(CURDIR)/public:/public dndmusicbot-js-build
|
||||
|
||||
PHONY: js image build
|
||||
PHONY: js image build clean
|
||||
|
||||
js: src/public/script.js
|
||||
js: image public/script.js
|
||||
|
||||
image: .jsimage
|
||||
|
||||
|
@ -13,14 +14,20 @@ image: .jsimage
|
|||
@docker build -t dndmusicbot-js-build .
|
||||
@touch .jsimage
|
||||
|
||||
src/node_modules:
|
||||
mkdir -p $@
|
||||
|
||||
src/yarn.lock: src/node_modules src/package.json
|
||||
@docker run --rm --user $(CURRENT_UID) -v $(CURDIR)/src:/app dndmusicbot-js-build install --production=false --check-files
|
||||
$(YARN)
|
||||
@touch -mr $(shell ls -Atd $? | head -1) $@
|
||||
|
||||
src/public/script.js: src/script.js src/yarn.lock
|
||||
@docker run --user $(CURRENT_UID) -v $(CURDIR)/src:/app dndmusicbot-js-build build
|
||||
public/script.js: src/script.js src/yarn.lock
|
||||
$(YARN) build
|
||||
|
||||
$(APPLICATION_NAME): *.go ffmpeg/*.go speaker/*.go
|
||||
@go build
|
||||
|
||||
build: image js $(APPLICATION_NAME)
|
||||
|
||||
clean:
|
||||
rm -r public/* src/node_modules .jsimage $(APPLICATION_NAME)
|
||||
|
|
|
@ -22,7 +22,7 @@ func init() {
|
|||
app.router.GET("/play/:playlist", app.Play)
|
||||
app.router.GET("/reset", app.Reset)
|
||||
|
||||
app.router.ServeFiles("/js/*filepath", http.Dir("src/public"))
|
||||
app.router.ServeFiles("/js/*filepath", http.Dir("public"))
|
||||
app.router.ServeFiles("/css/*filepath", http.Dir("css"))
|
||||
|
||||
app.router.HandlerFunc("GET", "/ws", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"scripts": {
|
||||
"build": "esbuild script.js --bundle --outdir=public/"
|
||||
"build": "esbuild script.js --bundle --outdir=/public/"
|
||||
},
|
||||
"dependencies": {
|
||||
"esbuild": "^0.15.14",
|
||||
|
|
Loading…
Reference in New Issue