-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (21 loc) · 800 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## Build
FROM golang:1.23-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] \
&& go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
WORKDIR /app
COPY ./ /app
RUN templ generate -path ./components \
&& tailwindcss -i ./styles/input.css -o ./dist/assets/css/output@${VERSION}.css --minify \
&& sqlc generate
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"]