Skip to content

Commit 47ce757

Browse files
committed
fix docker build
1 parent 2766c0f commit 47ce757

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

Dockerfile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,21 @@ RUN git clone https://github.com/fdddf/xcstrings-translator.git . && \
1616
# Builder stage
1717
FROM 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
2822
WORKDIR /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
3730
COPY --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
4336
FROM alpine:latest
@@ -69,8 +62,11 @@ USER nonroot:nonroot
6962

7063
# Health check
7164
HEALTHCHECK --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
7568
ENTRYPOINT ["xcstrings-translator"]
76-
CMD ["--help"]
69+
CMD ["serve"]
70+
71+
# Expose default port
72+
EXPOSE 8080

0 commit comments

Comments
 (0)