Setup Docker building.

This commit is contained in:
emil28092005
2026-01-14 04:19:00 +03:00
parent 7df170e37d
commit e883aac2e8
4 changed files with 48 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
FROM golang:1.25.5-alpine AS builder
RUN apk add --no-cache build-base
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o shagram ./cmd/server
FROM alpine:latest
RUN apk --no-cache add ca-certificates sqlite-libs
WORKDIR /app
COPY --from=builder /app/shagram .
COPY static ./static
COPY migrations ./migrations
RUN mkdir -p /app/data
EXPOSE 8080
CMD ["./shagram"]