feat: migrate to zine
This commit is contained in:
31
Dockerfile
31
Dockerfile
@@ -1,29 +1,12 @@
|
||||
FROM golang:1.23-alpine as builder
|
||||
FROM busybox:latest
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
RUN adduser -D static
|
||||
USER static
|
||||
WORKDIR /home/static
|
||||
|
||||
# Copy and download dependencies
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY ./zig-out/ .
|
||||
|
||||
# Copy the source code
|
||||
COPY . .
|
||||
EXPOSE 3000
|
||||
|
||||
# Build the Go application
|
||||
RUN go build -o server .
|
||||
CMD ["busybox", "httpd", "-f", "-v", "-p", "3000"]
|
||||
|
||||
# Create a minimal runtime image
|
||||
FROM alpine:latest
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /root/
|
||||
|
||||
# Copy the compiled binary from the builder
|
||||
COPY --from=builder /app/server .
|
||||
|
||||
# Expose the application port (e.g., 8080)
|
||||
EXPOSE 8080
|
||||
|
||||
# Run the application
|
||||
CMD ["./server"]
|
||||
|
||||
Reference in New Issue
Block a user