Files
archived-rttys-zhaojh329/Dockerfile
T
linG 18ecdb50ef code fs, _ := fs.Sub(staticFs, ui/dist) file directory not exist (#98)
* update `html` to `ui`

* add `node` version

* fixed `fs, _ := fs.Sub(staticFs, ui/dist)` used file directory not exist at build time
2021-12-17 14:22:51 +08:00

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"]