diff options
author | Tim Keller <tjkeller.xyz> | 2025-05-23 22:12:05 -0500 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2025-05-23 22:12:05 -0500 |
commit | 285c3e573e1d01b952342aeaf91aa09303883ebf (patch) | |
tree | 11338a9e0924bb1e18303c5f07e651ef44b4d34d /Dockerfile | |
parent | 865911f8ffdac7d1d9773570216c0bd35fc601d9 (diff) | |
download | mintube-285c3e573e1d01b952342aeaf91aa09303883ebf.tar.xz mintube-285c3e573e1d01b952342aeaf91aa09303883ebf.zip |
docker support and readme
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7e389c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,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"] |