Skip to content

Commit 81b12c9

Browse files
committed
setup(run-script): update run.sh script
1 parent af842b5 commit 81b12c9

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ FROM alpine:latest as run
1212
RUN apk add yt-dlp
1313

1414
WORKDIR /app
15-
COPY --from=build /app/dankmuzikk ./run
15+
COPY --from=build /app/dankmuzikk ./dankmuzikk
16+
COPY --from=build /app/run.sh ./run.sh
1617

1718
EXPOSE 8080
1819

19-
CMD ["./run", "serve"]
20+
CMD ["./run.sh", "prod"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ init:
2323
# dev runs the development server where it builds the tailwind css sheet,
2424
# and compiles the project whenever a file is changed.
2525
dev:
26-
templ generate --watch --cmd="./run.sh"
26+
templ generate --watch --cmd="./run.sh dev"
2727

2828
clean:
2929
go clean

run.sh

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
#!/bin/sh
2-
# This script is used to compile tailwind's style sheet, and run the web server.
3-
# Also this is supposed to be ran using templ's CLI, i.e.
4-
# templ generate --watch --cmd="./run.sh"
5-
# idk, that's it.
62

7-
go generate
8-
go run . serve
3+
dev() {
4+
# This function is used to compile tailwind's style sheet, and run the web server.
5+
# Also this is supposed to be ran using templ's CLI, i.e.
6+
# templ generate --watch --cmd="./run.sh"
7+
# idk, that's it.
8+
9+
go generate
10+
go run . serve
11+
}
12+
13+
prod() {
14+
./dankmuzikk migrate
15+
./dankmuzikk serve
16+
}
17+
18+
if [ $1 == "dev" ]; then
19+
dev
20+
fi
21+
22+
if [ $1 == "prod" ]; then
23+
prod
24+
fi

0 commit comments

Comments
 (0)