Browse Source

修复v2.4.0的docker-compose的启动异常问题

main
SliverHorn 4 years ago
parent
commit
8946c97d22
  1. 10
      .docker-compose/shell/server-handle.sh
  2. 2
      docker-compose.yaml
  3. 5
      dockerfile_server

10
.docker-compose/shell/server-handle.sh

@ -61,11 +61,11 @@ captcha:
# mysql connect configuration # mysql connect configuration
mysql: mysql:
path: '177.7.0.13:3306'
config: 'charset=utf8mb4&parseTime=True&loc=Local'
db-name: 'qmPlus'
username: 'root'
password: 'Aa@6447985'
path: ''
config: ''
db-name: ''
username: ''
password: ''
max-idle-conns: 10 max-idle-conns: 10
max-open-conns: 100 max-open-conns: 100
log-mode: false log-mode: false

2
docker-compose.yaml

@ -1,4 +1,4 @@
version: "3.8"
version: "3"
networks: networks:
network: network:

5
dockerfile_server

@ -12,20 +12,17 @@ RUN sh ./server-handle.sh
RUN rm -f server-handle.sh RUN rm -f server-handle.sh
RUN cat ./config.yaml RUN cat ./config.yaml
RUN go build -o gva cmd/main.go
RUN go env && go build -o server . RUN go env && go build -o server .
FROM alpine:latest FROM alpine:latest
LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com" LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"
WORKDIR /go/src/gin-vue-admin WORKDIR /go/src/gin-vue-admin
COPY --from=0 /go/src/gin-vue-admin/gva ./
COPY --from=0 /go/src/gin-vue-admin/server ./ COPY --from=0 /go/src/gin-vue-admin/server ./
COPY --from=0 /go/src/gin-vue-admin/config.yaml ./ COPY --from=0 /go/src/gin-vue-admin/config.yaml ./
COPY --from=0 /go/src/gin-vue-admin/resource ./resource COPY --from=0 /go/src/gin-vue-admin/resource ./resource
EXPOSE 8888 EXPOSE 8888
ENTRYPOINT ./gva initdb && ./server
ENTRYPOINT ./server
Loading…
Cancel
Save