File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,28 +16,21 @@ RUN git clone https://github.com/fdddf/xcstrings-translator.git . && \
1616# Builder stage
1717FROM golang:1.25-alpine AS builder
1818
19- # Install build dependencies
20- RUN apk add --no-cache \
21- git \
22- gcc \
23- musl-dev \
24- nodejs \
25- npm
19+ RUN apk update && apk add --no-cache make gcc musl-dev
2620
2721# Set working directory
2822WORKDIR /app
2923
30- # Clone the repository
31- RUN git clone https://github.com/fdddf/xcstrings-translator.git .
24+ COPY . .
3225
3326# Install Go dependencies
34- RUN go mod tidy
27+ RUN go env -w GOPROXY= 'https://goproxy.cn,direct' && go mod tidy
3528
3629# Copy built UI assets from ui-builder stage
3730COPY --from=ui-builder /app/webui/dist ./webui/dist
3831
39- # Build the application with GUI tag using Makefile
40- RUN make gui
32+ # Build the application using Makefile
33+ RUN make
4134
4235# Final stage - minimal Alpine image
4336FROM alpine:latest
@@ -69,8 +62,11 @@ USER nonroot:nonroot
6962
7063# Health check
7164HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
72- CMD [ "sh" , "-c" , "xcstrings-translator --help" ]
65+ CMD nc -z localhost 8080 || exit 1
7366
7467# Default command
7568ENTRYPOINT ["xcstrings-translator" ]
76- CMD ["--help" ]
69+ CMD ["serve" ]
70+
71+ # Expose default port
72+ EXPOSE 8080
You can’t perform that action at this time.
0 commit comments