mirror of
https://github.com/netfun2000/rttys_zhaojh329.git
synced 2026-02-27 09:53:24 +08:00
18ecdb50ef
* update `html` to `ui` * add `node` version * fixed `fs, _ := fs.Sub(staticFs, ui/dist)` used file directory not exist at build time
22 lines
493 B
Docker
22 lines
493 B
Docker
FROM node:16
|
|
WORKDIR /build
|
|
COPY ./ui ./
|
|
RUN npm install && npm run build
|
|
|
|
FROM golang:alpine
|
|
WORKDIR /build
|
|
COPY . ./
|
|
COPY --from=0 /build/dist /build/ui/dist
|
|
RUN apk update && \
|
|
apk add git gcc linux-pam-dev libc-dev && \
|
|
go get -v github.com/rakyll/statik && \
|
|
statik -src=/build/ui/dist && \
|
|
go build -ldflags "-w -s"
|
|
|
|
FROM alpine
|
|
WORKDIR /rttys
|
|
RUN apk update && \
|
|
apk add --no-cache linux-pam-dev
|
|
COPY --from=1 /build/rttys /rttys/rttys
|
|
ENTRYPOINT ["/rttys/rttys"]
|