public setup
This commit is contained in:
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
# Stage 1: Builder
|
||||
FROM golang:1.22.5-alpine AS builder
|
||||
RUN apk add --no-cache gcc g++
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
RUN go mod download
|
||||
RUN go install github.com/a-h/templ/cmd/templ@latest
|
||||
RUN templ generate
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build -o todos-app
|
||||
|
||||
# Stage 2: Final Image
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
WORKDIR /app
|
||||
VOLUME /app/data
|
||||
|
||||
COPY --from=builder /app/todos-app .
|
||||
COPY --from=builder /app/static /app/static
|
||||
|
||||
CMD ["./todos-app"]
|
||||
Reference in New Issue
Block a user