# lot-backend

FROM golang:1.19.13-alpine3.18 AS go-builder

ENV \
    GO111MODULE=on \
    CGO_ENABLED=0 \
    GOPROXY=https://goproxy.cn,direct


WORKDIR /home/pastebin
COPY ./ backend/

WORKDIR /home/pastebin/backend

# Build your Go code
RUN go build -o ./pastebin .

# Final image for running only the built executable
FROM alpine:latest

# Copy Go backend executable
COPY --from=go-builder /home/pastebin/backend/pastebin /home/pastebin/backend/
COPY --from=go-builder /home/pastebin/backend/config.yaml /home/pastebin/backend/

# 设置工作目录，这里需要根据实际情况修改
WORKDIR /home/pastebin/backend

# 你可以添加其他一些需要的命令或设置，根据实际情况进行调整

# 例如，你可能需要设置启动命令
CMD ["/home/pastebin/backend/pastebin"]



