forked from ZeroDeng01/sublinkPro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ci
More file actions
41 lines (30 loc) · 1.26 KB
/
Copy pathDockerfile.ci
File metadata and controls
41 lines (30 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# CI-specific Dockerfile
# Assumes binaries and static files are already built and available in the context
FROM alpine:latest
ARG TARGETARCH
WORKDIR /app
ENV GIN_MODE=release
# Install dependencies and cloudflared
RUN apk add --no-cache tzdata ca-certificates curl && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
arch="${TARGETARCH:-$(uname -m)}" && \
case "$arch" in \
amd64|x86_64) cloudflared_arch="amd64" ;; \
arm64|aarch64) cloudflared_arch="arm64" ;; \
*) echo "unsupported cloudflared architecture: $arch" >&2; exit 1 ;; \
esac && \
curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cloudflared_arch}" -o /usr/local/bin/cloudflared && \
chmod +x /usr/local/bin/cloudflared && \
cloudflared version
# Create directories
RUN mkdir -p /app/db /app/logs /app/template && \
chmod 777 /app/db /app/logs /app/template
# Copy static files (frontend)
COPY static /app/static
# Copy the specific binary for the target architecture
# The workflow must ensure these files exist in the build context
COPY build/sublinkPro-linux-${TARGETARCH} /app/sublinkPro
RUN chmod +x /app/sublinkPro
EXPOSE 8000
CMD ["/app/sublinkPro"]