我写了这个Dockerfile
Model.objects.raw("""SELECT * FROM document
ORDER BY IF(date_of_rectification > date_of_signature,
date_of_rectification, date_of_signature)""")
使用# Stage I
FROM golang:alpine as builder
RUN apk update && apk add --no-cache git ca-certificates
COPY . $GOPATH/src/realtime_chat/chat
WORKDIR $GOPATH/src/realtime_chat/chat
RUN go get github.com/gorilla/websocket
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o /go/bin/chat
# Stage II
FROM alpine
COPY ./views /go/bin/views
COPY --from=builder /go/bin/chat /go/bin/chat
ENTRYPOINT [ "/go/bin/chat" ]
启动容器后,容器开始工作了,但是我没有来自应用程序的响应。但是,如果我要进入容器,请通过键入docker run -d -p 80:80 image_name
app start response手动停止并运行应用程序。
我试图公开端口,将入口点更改为cmd,更改基本映像(对于两个阶段)