aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 7e389c46fd647d7cdad03c559e18f711dca74d7a (plain)
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
# Use an official Go image as the builder
FROM golang:1.24-alpine AS builder

WORKDIR /app

# Copy go mod and sum first
COPY go.mod go.sum ./
RUN go mod download

# Copy the source code
COPY . .

# Build the Go app
RUN go build -o mintube .

# Final lightweight image
FROM alpine:latest

WORKDIR /app
COPY --from=builder /app/mintube .
COPY --from=builder /app/templates ./templates
COPY --from=builder /app/static ./static

# If your app needs ports exposed (e.g., a web server)
EXPOSE 8080

# Run the Go app
CMD ["./mintube"]