|
|
@@ -32,7 +32,13 @@ FROM node:18-alpine AS builder-admin-frontend
|
|
32
|
32
|
# Set working directory
|
|
33
|
33
|
WORKDIR /frontend
|
|
34
|
34
|
|
|
35
|
|
-RUN apk update && apk add git --no-cache
|
|
|
35
|
+ARG COUNTRY
|
|
|
36
|
+# Install required tools without caching index to minimize image size
|
|
|
37
|
+RUN if [ "$COUNTRY" = "CN" ] ; then \
|
|
|
38
|
+ echo "It is in China, updating the repositories"; \
|
|
|
39
|
+ sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories; \
|
|
|
40
|
+ fi && \
|
|
|
41
|
+ apk update && apk add --no-cache git
|
|
36
|
42
|
|
|
37
|
43
|
# Clone the frontend repository
|
|
38
|
44
|
RUN git clone https://github.com/lejianwen/rustdesk-api-web .
|
|
|
@@ -47,7 +53,13 @@ FROM alpine:latest
|
|
47
|
53
|
WORKDIR /app
|
|
48
|
54
|
|
|
49
|
55
|
# Install necessary runtime dependencies
|
|
50
|
|
-RUN apk add --no-cache tzdata file
|
|
|
56
|
+# Install required tools without caching index to minimize image size
|
|
|
57
|
+ARG COUNTRY
|
|
|
58
|
+RUN if [ "$COUNTRY" = "CN" ] ; then \
|
|
|
59
|
+ echo "It is in China, updating the repositories"; \
|
|
|
60
|
+ sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories; \
|
|
|
61
|
+ fi && \
|
|
|
62
|
+ apk update && apk add --no-cache tzdata file
|
|
51
|
63
|
|
|
52
|
64
|
# Copy the built application and resources from the builder stage
|
|
53
|
65
|
COPY --from=builder-backend /app/release /app/
|