2023-12-02 12:58:02 +00:00
|
|
|
FROM node:latest as frontend-builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ministream-frontend/package-lock.json /app/package-lock.json
|
|
|
|
COPY ministream-frontend/package.json /app/package.json
|
|
|
|
COPY ministream-frontend/tsconfig.json /app/tsconfig.json
|
|
|
|
RUN npm install
|
|
|
|
COPY ministream-frontend/src /app/src
|
|
|
|
RUN npm run-script build
|
|
|
|
|
2023-11-30 18:32:38 +00:00
|
|
|
FROM golang:alpine as builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod /app/go.mod
|
|
|
|
COPY go.sum /app/go.sum
|
|
|
|
RUN go mod download
|
2023-12-02 12:58:02 +00:00
|
|
|
COPY main.go /app
|
|
|
|
COPY server /app/server
|
2023-12-02 13:06:00 +00:00
|
|
|
COPY --from=frontend-builder /app/dist /app/server/static
|
2023-11-30 18:32:38 +00:00
|
|
|
RUN go build -o ministream main.go
|
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
COPY --from=builder /app/ministream /usr/bin/ministream
|
2023-11-30 22:56:33 +00:00
|
|
|
EXPOSE 8080
|
|
|
|
EXPOSE 50000-50050/udp
|
2023-11-30 18:32:38 +00:00
|
|
|
CMD ["/usr/bin/ministream", "serve"]
|