28 lines
412 B
Docker
28 lines
412 B
Docker
FROM golang:alpine AS builder
|
|
|
|
# go-sqlite3 is a cgo package, so it needs a C toolchain
|
|
RUN apk add --no-cache gcc musl-dev
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY src/*.go ./
|
|
COPY src/seed.sql ./
|
|
|
|
ENV CGO_ENABLED=1
|
|
RUN go build -o server .
|
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/server .
|
|
COPY static/ static/
|
|
COPY templates/ templates/
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["./server"]
|