Files
likedream/Dockerfile
T
2025-11-10 13:38:41 +08:00

20 lines
414 B
Docker

FROM golang:latest AS backend-builder
RUN apt update
RUN apt install -y build-essential
WORKDIR /build
COPY . .
ENV CGO_ENABLED=1
RUN go build -ldflags="-s -w" -o bin/server
RUN apt install -y upx-ucl
RUN upx --best --lzma bin/server
FROM golang:latest
COPY --from=backend-builder /build/bin/server /app/server
#COPY static /app/static
#COPY static/*.so /app/
WORKDIR /app
EXPOSE 8080
RUN ls -a
CMD ["./server"]