fix bug
This commit is contained in:
@@ -26,6 +26,19 @@ RUN CGO_ENABLED=1 GOOS=linux go build -a \
|
|||||||
-ldflags "-s -w --extldflags '-static -fpic'" \
|
-ldflags "-s -w --extldflags '-static -fpic'" \
|
||||||
-installsuffix cgo -o release/apimain cmd/apimain.go
|
-installsuffix cgo -o release/apimain cmd/apimain.go
|
||||||
|
|
||||||
|
# Stage 2: Frontend Build Stage (builder2)
|
||||||
|
FROM node:18-alpine AS builder2
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
|
WORKDIR /frontend
|
||||||
|
|
||||||
|
RUN apk update && apk add git --no-cache
|
||||||
|
|
||||||
|
# Clone the frontend repository
|
||||||
|
RUN git clone https://github.com/lejianwen/rustdesk-api-web .
|
||||||
|
|
||||||
|
# Install npm dependencies and build the frontend
|
||||||
|
RUN npm install && npm run build
|
||||||
|
|
||||||
# Stage 2: Final Image
|
# Stage 2: Final Image
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
@@ -40,6 +53,9 @@ RUN apk add --no-cache tzdata file
|
|||||||
COPY --from=builder /app/release /app/
|
COPY --from=builder /app/release /app/
|
||||||
COPY --from=builder /app/conf /app/conf/
|
COPY --from=builder /app/conf /app/conf/
|
||||||
COPY --from=builder /app/resources /app/resources/
|
COPY --from=builder /app/resources /app/resources/
|
||||||
|
COPY --from=builder /app/docs /app/docs/
|
||||||
|
# Copy frontend build from builder2 stage
|
||||||
|
COPY --from=builder2 /frontend/dist/ /app/resources/admin/
|
||||||
|
|
||||||
# Ensure the binary is correctly built and linked
|
# Ensure the binary is correctly built and linked
|
||||||
RUN file /app/apimain && \
|
RUN file /app/apimain && \
|
||||||
|
|||||||
@@ -3,20 +3,18 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile.dev
|
dockerfile: Dockerfile.dev
|
||||||
args:
|
# image: lejianwen/rustdesk-api
|
||||||
- DOCS=""
|
|
||||||
image: lejianwen/rustdesk-api
|
|
||||||
container_name: rustdesk-api
|
container_name: rustdesk-api
|
||||||
environment:
|
environment:
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
- RUSTDESK_API_RUSTDESK_ID_SERVER=192.168.1.66:21116
|
- RUSTDESK_API_RUSTDESK_ID_SERVER=192.168.1.66:21116
|
||||||
- RUSTDESK_API_RUSTDESK_RELAY_SERVER=192.168.1.66:21117
|
- RUSTDESK_API_RUSTDESK_RELAY_SERVER=192.168.1.66:21117
|
||||||
- RUSTDESK_API_RUSTDESK_API_SERVER=http://localhost:21114
|
- RUSTDESK_API_RUSTDESK_API_SERVER=http://127.0.0.1:21114
|
||||||
- RUSTDESK_API_RUSTDESK_KEY=123456789
|
- RUSTDESK_API_RUSTDESK_KEY=123456789
|
||||||
ports:
|
ports:
|
||||||
- 21114:21114
|
- 21114:21114
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/rustdesk/api:/app/data #将数据库挂载出来方便备份
|
- ./data/rustdesk/api:/app/data #将数据库挂载出来方便备份
|
||||||
# - ./conf:/app/conf # config
|
- ./conf:/app/conf # config
|
||||||
|
# - ./resources:/app/resources # 静态资源
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# command: sleep infnite
|
|
||||||
Reference in New Issue
Block a user