增加docker打包文件
continuous-integration/drone/tag Build encountered an error Details
continuous-integration/drone/push Build encountered an error Details

This commit is contained in:
giaogiao 2023-09-25 11:13:41 +08:00
parent dc4cd7d15b
commit 19eb8d85a5
2 changed files with 40 additions and 0 deletions

View File

@ -46,6 +46,27 @@ steps:
- sed -i 's?/manifest.json?/static/manifest.json?g' ./app/index.html
- bash bulid.sh
- name: 打包Docker镜像并推送
image: plugins/docker
volumes:
- name: outdir
path: /root/web
settings:
repo: linglingking/go_wol_web
use_cache: true
username:
from_secret: docker_name
password:
from_secret: docker_password
auto_tag: true # 自动打tag
# 也可以用下面这个手动指定
# tags:
# - latest
# - 0.0.1
when:
event: push
branch: master
volumes:
- name: outdir
host:

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM alpine
# 创建工作目录修改alpine源为中科大的源安装必要工具
RUN mkdir -p /app && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add ca-certificates && update-ca-certificates && \
apk add --update tzdata && \
rm -rf /var/cache/apk/*
WORKDIR /app
# 这个go-app 是上面.drone.yml里面编译生成的文件酌情修改
COPY /root/web/linux_amd64_main ./
ENV TZ=Asia/Shanghai
EXPOSE 1323
ENTRYPOINT ./linux_amd64_main