增加docker打包文件
This commit is contained in:
parent
dc4cd7d15b
commit
19eb8d85a5
21
.drone.yml
21
.drone.yml
|
@ -46,6 +46,27 @@ steps:
|
||||||
- sed -i 's?/manifest.json?/static/manifest.json?g' ./app/index.html
|
- sed -i 's?/manifest.json?/static/manifest.json?g' ./app/index.html
|
||||||
- bash bulid.sh
|
- 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:
|
volumes:
|
||||||
- name: outdir
|
- name: outdir
|
||||||
host:
|
host:
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue