You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
951 B

  1. FROM golang:alpine
  2. ENV GO111MODULE=on
  3. ENV GOPROXY=https://goproxy.io,direct
  4. WORKDIR /go/src/gin-vue-admin
  5. COPY server/ ./
  6. RUN cat ./config.yaml
  7. COPY .docker-compose/shell/server-handle.sh .
  8. RUN ls -al
  9. RUN sh ./server-handle.sh
  10. RUN rm -f server-handle.sh
  11. RUN cat ./config.yaml
  12. RUN go env && go build -o server .
  13. FROM alpine:latest
  14. LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"
  15. WORKDIR /go/src/gin-vue-admin
  16. COPY --from=0 /go/src/gin-vue-admin/server ./
  17. COPY --from=0 /go/src/gin-vue-admin/config.yaml ./
  18. COPY --from=0 /go/src/gin-vue-admin/resource ./resource
  19. ENTRYPOINT ./server
  20. # 根据Dockerfile生成Docker镜像
  21. # docker build -t gva-server:1.0 .
  22. #- 根据Docker镜像启动Docker容器
  23. # - 后台运行
  24. # - ```
  25. # docker run -d -p 8888:8888 --name gva-server-v1 gva-server:1.0
  26. # ```
  27. # - 以可交互模式运行, Ctrl + p + q
  28. # - ```
  29. # docker run -it -p 8888:8888 --name gva-server-v1 gva-server:1.0
  30. # ```