Files
likedream/Dockerfile
T

20 lines
406 B
Docker

FROM golang:latest AS backend-builder
RUN apt update
RUN apt install build-essential
WORKDIR /build
COPY . .
ENV CGO_ENABLED=1
RUN go build -ldflags="-s -w" -o bin/server
RUN apt install 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"]