quite a lot of things
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -1,23 +1,25 @@
|
||||
FROM golang:1.24.4-alpine AS build
|
||||
RUN apk add --no-cache curl libstdc++ libgcc alpine-sdk
|
||||
FROM golang:1.25.1-alpine AS build
|
||||
RUN apk add --no-cache curl libstdc++ libgcc alpine-sdk npm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install sass for SCSS compilation
|
||||
RUN npm install -g sass
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go install github.com/a-h/templ/cmd/templ@latest && \
|
||||
templ generate && \
|
||||
curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64-musl -o tailwindcss && \
|
||||
chmod +x tailwindcss && \
|
||||
./tailwindcss -i cmd/web/styles/input.css -o cmd/web/assets/css/output.css
|
||||
|
||||
# Compile SCSS to CSS
|
||||
RUN sass internal/web/assets/scss/main.scss internal/web/assets/css/output.css --style=compressed
|
||||
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -o main cmd/api/main.go
|
||||
|
||||
FROM alpine:3.20.1 AS prod
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/main /app/main
|
||||
COPY --from=build /app/internal/web/assets /app/internal/web/assets
|
||||
EXPOSE ${PORT}
|
||||
CMD ["./main"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user