-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (23 loc) · 813 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
FROM node:20-slim AS base_node
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
COPY pnpm-lock.yaml package.json input.css ./
COPY . ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm tailwindcss -i ./input.css -o ./cmd/web/assets/tailwind.css
FROM golang:1.22-alpine as builder
WORKDIR /app
RUN apk add --no-cache make
RUN go install github.com/a-h/templ/cmd/templ@v0.2.663
COPY . ./
COPY --from=base_node /app/cmd/web/assets/tailwind.css /app/cmd/web/assets/tailwind.css
RUN templ generate
RUN GOOS=linux go build -tags remote -o /app/bin/main /app/cmd/api/main.go
FROM alpine:3.19.1
WORKDIR /app
RUN apk add --no-cache ca-certificates
COPY --from=builder /app/bin/main /app/wishlist
EXPOSE 8080
ENTRYPOINT [ "/app/wishlist" ]