This commit is contained in:
xuyucheng 2021-11-25 10:09:24 +08:00
parent 03894a4a4d
commit f80b1e952a
2 changed files with 24 additions and 0 deletions

15
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,15 @@
stages:
- deploy
job:
stage: deploy
script:
# - docker stop esg-report-backend
# - docker rm esg-report-backend
- docker build -t esg-report-backend .
- docker run -d --restart=always --network=host --name esg-report-backend esg-report-backend
only:
- master
tags:
- esg-report-backend

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM golang:latest
ENV GOPROXY https://goproxy.cn,direct
WORKDIR /home/esg_report_backend
COPY . .
RUN go build -o app .
WORKDIR /dist
RUN cp /home/esg_report_backend
EXPOSE 9090
ENTRYPOINT ["/dist/app"]