mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-rtty.git
synced 2026-01-27 10:23:13 +00:00
31 lines
880 B
Docker
31 lines
880 B
Docker
FROM node:16 AS source
|
|
ARG RTTYS_VERSION=v3.5.0
|
|
RUN GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone https://github.com/zhaojh329/rttys.git /rttys/ \
|
|
&& cd /rttys \
|
|
&& git checkout $RTTYS_VERSION
|
|
|
|
FROM node:16 AS frontend
|
|
WORKDIR /build
|
|
COPY --from=source /rttys/frontend ./
|
|
RUN npm install && npm run build
|
|
|
|
FROM golang:alpine AS backend
|
|
WORKDIR /build
|
|
COPY --from=source /rttys/ ./
|
|
COPY --from=frontend /build/dist /build/dist
|
|
RUN cp -r /build/dist /build/frontend/dist && \
|
|
apk update && \
|
|
apk add git gcc linux-pam-dev libc-dev && \
|
|
go get -v github.com/rakyll/statik && \
|
|
statik -src=/build/dist && \
|
|
go build -ldflags "-w -s"
|
|
|
|
FROM alpine AS runtime
|
|
WORKDIR /rttys
|
|
RUN apk update && \
|
|
apk add --no-cache linux-pam-dev
|
|
COPY --from=backend /build/rttys /rttys/rttys
|
|
COPY docker-entrypoint.sh /
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
CMD ["/rttys/rttys"]
|