🔨 Update dockerfile

This commit is contained in:
LittleSheep 2024-02-13 20:48:40 +08:00
parent 1a562fbee8
commit 46736c12b9

View File

@ -1,20 +1,16 @@
# Building Backend # Building Backend
FROM golang:alpine as roadsign-server FROM rust:alpine as roadsign-server
RUN apk add nodejs npm RUN apk add nodejs npm
WORKDIR /source WORKDIR /source
COPY . . COPY . .
WORKDIR /source/pkg/sideload/view RUN cargo build --release
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
# Runtime # 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 EXPOSE 81