-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflows and add a docker file
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
## Build | ||
FROM golang:1.22-alpine AS build | ||
|
||
ARG VERSION='dev' | ||
|
||
RUN apk update && apk add --no-cache curl | ||
|
||
RUN curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 \ | ||
&& chmod +x tailwindcss-linux-x64 \ | ||
&& mv tailwindcss-linux-x64 /usr/local/bin/tailwindcss | ||
|
||
RUN go install github.com/a-h/templ/cmd/[email protected] | ||
|
||
WORKDIR /app | ||
|
||
COPY ./ /app | ||
|
||
RUN templ generate -path ./components \ | ||
&& tailwindcss -i ./styles/input.css -o ./dist/assets/css/output@${VERSION}.css --minify | ||
|
||
RUN go build -ldflags="-s -w -X version.Value=${VERSION}" -o my-app | ||
|
||
## Deploy | ||
FROM gcr.io/distroless/static-debian12 | ||
|
||
WORKDIR / | ||
|
||
COPY --from=build /app/my-app /my-app | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["/my-app"] |