mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
修改dockerfile
This commit is contained in:
parent
4bc1deda42
commit
7ecd38ad1f
21
.github/workflows/docker.yml
vendored
21
.github/workflows/docker.yml
vendored
|
@ -1,9 +1,6 @@
|
||||||
name: Publish Docker Image
|
name: Publish Docker Image
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches:
|
|
||||||
- v*
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -33,19 +30,3 @@ jobs:
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
run: |
|
run: |
|
||||||
docker buildx build --build-arg SSH_PRIVATE_KEY="${SSH_PRIVATE_KEY}" --output "type=image,push=true" --platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x --tag whyour/qinglong:latest docker/
|
docker buildx build --build-arg SSH_PRIVATE_KEY="${SSH_PRIVATE_KEY}" --output "type=image,push=true" --platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x --tag whyour/qinglong:latest docker/
|
||||||
|
|
||||||
- name: Replace branch without `v`
|
|
||||||
if: startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/master'
|
|
||||||
uses: actions/github-script@v1
|
|
||||||
id: version
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
return context.payload.ref.replace(/\/?refs\/heads\/v/, '')
|
|
||||||
result-encoding: string
|
|
||||||
|
|
||||||
- name: Docker buildx image and push on release
|
|
||||||
env:
|
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
||||||
if: startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/master'
|
|
||||||
run: |
|
|
||||||
docker buildx build --build-arg SSH_PRIVATE_KEY="${SSH_PRIVATE_KEY}" --output "type=image,push=true" --platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x --tag whyour/qinglong:${{steps.version.outputs.result}} docker/
|
|
||||||
|
|
|
@ -29,21 +29,20 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
&& echo "Asia/Shanghai" > /etc/timezone \
|
&& echo "Asia/Shanghai" > /etc/timezone \
|
||||||
&& touch ~/.bashrc \
|
&& touch ~/.bashrc \
|
||||||
&& mkdir /run/nginx \
|
&& mkdir /run/nginx \
|
||||||
|
&& git clone -b ${QL_BRANCH} https://github.com/whyour/qinglong-static.git /static \
|
||||||
&& git clone -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \
|
&& git clone -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \
|
||||||
&& git config --global user.email "qinglong@@users.noreply.github.com" \
|
&& git config --global user.email "qinglong@@users.noreply.github.com" \
|
||||||
&& git config --global user.name "qinglong" \
|
&& git config --global user.name "qinglong" \
|
||||||
&& git config --global pull.rebase true \
|
&& git config --global pull.rebase true \
|
||||||
&& cd ${QL_DIR} \
|
&& cd ${QL_DIR} \
|
||||||
|
&& cp -rf /static/* ./ \
|
||||||
|
&& rm -rf /static \
|
||||||
&& cp -f .env.example .env \
|
&& cp -f .env.example .env \
|
||||||
&& chmod 777 ${QL_DIR}/shell/*.sh \
|
&& chmod 777 ${QL_DIR}/shell/*.sh \
|
||||||
&& chmod 777 ${QL_DIR}/docker/*.sh \
|
&& chmod 777 ${QL_DIR}/docker/*.sh \
|
||||||
&& npm install -g pm2 \
|
&& npm install -g pm2 \
|
||||||
&& npm install -g pnpm \
|
&& npm install -g pnpm \
|
||||||
&& rm -rf /root/.npm \
|
&& rm -rf /root/.npm \
|
||||||
&& pnpm install \
|
|
||||||
&& pnpm build \
|
|
||||||
&& pnpm build-back \
|
|
||||||
&& rm -rf node_modules \
|
|
||||||
&& pnpm install --prod \
|
&& pnpm install --prod \
|
||||||
&& rm -rf /root/.pnpm-store
|
&& rm -rf /root/.pnpm-store
|
||||||
ENTRYPOINT ["./docker/docker-entrypoint.sh"]
|
ENTRYPOINT ["./docker/docker-entrypoint.sh"]
|
Loading…
Reference in New Issue
Block a user