minetest-web/Dockerfile

17 lines
438 B
Docker
Raw Normal View History

2023-09-20 19:35:05 +02:00
FROM node:20.7.0 as node-builder
WORKDIR /public
COPY public/ /public
RUN npm ci && npm run jshint && npm run bundle
FROM golang:1.21.1 as golang-builder
WORKDIR /app
COPY . /app/
COPY --from=node-builder /public /app/public
RUN go test ./...
RUN CGO_ENABLED=0 go build -ldflags="-s -w -extldflags=-static" .
2023-09-20 15:20:46 +02:00
FROM alpine:3.18.3
2023-09-20 19:35:05 +02:00
COPY --from=golang-builder /app/minetest-web /bin/minetest-web
2023-09-20 15:20:46 +02:00
EXPOSE 8080
ENTRYPOINT ["/bin/minetest-web"]