HuggingFace0920 commited on
Commit
c2dd996
verified
1 Parent(s): 3f0a6f6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -8
Dockerfile CHANGED
@@ -1,13 +1,38 @@
1
- FROM finab/bark-server
 
2
 
3
- ARG TIMEZONE=Asia/Shanghai
 
4
 
5
- ENV TZ=${TIMEZONE}
 
6
 
7
- RUN mkdir -p /data && \
8
- chmod 777 /data
9
 
10
- VOLUME /data
 
11
 
12
- # 璁剧疆榛樿鍛戒护
13
- CMD ["bark-server"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]