aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Dockerfile b/Dockerfile
index bce712d..cf67d3c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
# Build stage
-FROM golang:1.22-alpine AS builder
+FROM golang:1.24-alpine AS builder
WORKDIR /app
@@ -28,13 +28,15 @@ RUN apk add --no-cache ca-certificates tzdata
# Create non-root user
RUN adduser -D -u 1000 kaze
-USER kaze
+
+# Create data directory before switching user
+RUN mkdir -p /app/data && chown -R kaze:kaze /app
# Copy binary from builder
-COPY --from=builder /app/kaze .
+COPY --from=builder --chown=kaze:kaze /app/kaze .
-# Create data directory
-RUN mkdir -p /app/data
+# Switch to non-root user
+USER kaze
# Expose port
EXPOSE 8080