From 46736c12b9a8fdd93773be73e9c9cf3b0fe93977 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 13 Feb 2024 20:48:40 +0800 Subject: [PATCH] :hammer: Update dockerfile --- Dockerfile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 499036c..21a711f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,16 @@ # Building Backend -FROM golang:alpine as roadsign-server +FROM rust:alpine as roadsign-server RUN apk add nodejs npm WORKDIR /source COPY . . -WORKDIR /source/pkg/sideload/view -RUN npm install -RUN npm run build -WORKDIR /source -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs -o /dist ./pkg/cmd/server.rs/main.go +RUN cargo build --release # Runtime -FROM golang:alpine +FROM alpine:latest -COPY --from=roadsign-server /dist /roadsign/server +COPY --from=roadsign-server /source/target/release/roadsign /roadsign/server EXPOSE 81