Initial commit
This commit is contained in:
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
# Build stage
|
||||
FROM alpine:3.22 AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
RUN apk add --no-cache build-base
|
||||
|
||||
# Build if needed
|
||||
COPY . .
|
||||
RUN make build
|
||||
|
||||
# Runtime stage
|
||||
FROM alpine:3.22
|
||||
WORKDIR /app
|
||||
|
||||
# Create non root user and group
|
||||
RUN addgroup -S zxc && \
|
||||
adduser -S appuser -G zxc
|
||||
|
||||
# Copy from builder
|
||||
COPY --from=builder /app/mybinary /app/mybinary
|
||||
|
||||
# Set ownership
|
||||
RUN chown zxc:zxc /app/mybinary
|
||||
|
||||
USER appuser
|
||||
|
||||
# Open ports
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/app/mybinary"]
|
||||
Reference in New Issue
Block a user