Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +33 -8
Dockerfile
CHANGED
|
@@ -1,13 +1,38 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a minimal Alpine-based Go image for building
|
| 2 |
+
FROM golang:1.21-alpine AS builder
|
| 3 |
|
| 4 |
+
# Install build dependencies
|
| 5 |
+
RUN apk add --no-cache git make
|
| 6 |
|
| 7 |
+
# Set the working directory
|
| 8 |
+
WORKDIR /app
|
| 9 |
|
| 10 |
+
# Clone the bark-server repository
|
| 11 |
+
RUN git clone https://github.com/Finb/bark-server.git .
|
| 12 |
|
| 13 |
+
# Build the application
|
| 14 |
+
RUN make build
|
| 15 |
|
| 16 |
+
# Create the final lightweight image
|
| 17 |
+
FROM alpine:3.18
|
| 18 |
+
|
| 19 |
+
# Install necessary runtime dependencies
|
| 20 |
+
RUN apk add --no-cache ca-certificates tzdata
|
| 21 |
+
|
| 22 |
+
# Set the working directory
|
| 23 |
+
WORKDIR /app
|
| 24 |
+
|
| 25 |
+
# Copy the built binary from the builder stage
|
| 26 |
+
COPY --from=builder /app/bin/bark-server .
|
| 27 |
+
|
| 28 |
+
# Copy configuration files if needed
|
| 29 |
+
# COPY --from=builder /app/config.example.yaml ./config.yaml
|
| 30 |
+
|
| 31 |
+
# Expose the default port (8080 as per the repository)
|
| 32 |
+
EXPOSE 8080
|
| 33 |
+
|
| 34 |
+
# Set the entrypoint to run the server
|
| 35 |
+
ENTRYPOINT ["./bark-server"]
|
| 36 |
+
|
| 37 |
+
# Default command (can be overridden)
|
| 38 |
+
CMD ["serve"]
|