Files
frp/dockerfiles/Dockerfile-for-frps
T
fatedierandGitHub 031716afd1 Merge pull request #5569 from fatedier/fix/docker-workspace-lockfile
fix(docker): install web dependencies from the workspace lockfile
2026-10-15 13:01:59 +08:00

28 lines
683 B
Plaintext

FROM node:22 AS web-builder
WORKDIR /web
COPY web/package.json web/package-lock.json ./
COPY web/shared/package.json ./shared/package.json
COPY web/frpc/package.json ./frpc/package.json
COPY web/frps/package.json ./frps/package.json
RUN npm ci
COPY web/shared/ ./shared/
COPY web/frps/ ./frps/
RUN npm run build --workspace frps
FROM golang:1.26 AS building
COPY . /building
COPY --from=web-builder /web/frps/dist /building/web/frps/dist
WORKDIR /building
RUN env CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -tags frps -o bin/frps ./cmd/frps
FROM alpine:3
RUN apk add --no-cache tzdata
COPY --from=building /building/bin/frps /usr/bin/frps
ENTRYPOINT ["/usr/bin/frps"]