Compare commits
No commits in common. "main" and "v2.1.0" have entirely different histories.
31
.github/workflows/build.yml
vendored
Normal file
31
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
name: Build image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 1 * * 0'
|
||||
push:
|
||||
tags: [ 'v*.*.*' ]
|
||||
env:
|
||||
PHP_EXTENSION_INSTALL_VERSION: 'latest'
|
||||
COMPOSER_VERSION: 'latest'
|
||||
jobs:
|
||||
build:
|
||||
name: Build PHP ${{ matrix.php-version }}
|
||||
runs-on: '${{ matrix.os }}'
|
||||
env:
|
||||
ALPINE_VERSION: '${{ matrix.alpine-version }}'
|
||||
PHP_CLI_VERSION: '${{ matrix.php-version }}-cli-alpine'
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
php-version: [ '7.4', '8.0', '8.1' ]
|
||||
max-parallel: 8
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: docker-compose build webman
|
||||
- name: Login
|
||||
run: docker login --username krisss -p ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
|
||||
- name: Push
|
||||
run: docker push krisss/docker-webman:${PHP_CLI_VERSION}
|
71
.github/workflows/docker-image.yml
vendored
71
.github/workflows/docker-image.yml
vendored
@ -1,71 +0,0 @@
|
||||
name: Build Docker Image And Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
# on:
|
||||
# push:
|
||||
# tags: [ 'v*.*.*' ]
|
||||
|
||||
env:
|
||||
PHP_EXTENSION_INSTALL_VERSION: 'latest'
|
||||
COMPOSER_VERSION: 'latest'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build PHP 8.0
|
||||
runs-on: ubuntu-latest
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
env:
|
||||
PHP_CLI_VERSION: 8.0-cli-alpine
|
||||
steps:
|
||||
- name: Login to Git Docker Hub
|
||||
# https://github.com/docker/login-action#docker-hub
|
||||
uses: http://git.des8.com/docker/login-action@master
|
||||
with:
|
||||
registry: git.des8.com
|
||||
username: ${{ secrets.HUB_USERNAME }}
|
||||
password: ${{ secrets.HUB_PASSWORD }}
|
||||
|
||||
- name: Checkout
|
||||
uses: http://git.des8.com/docker/checkout@main
|
||||
with:
|
||||
username: ${{ secrets.HUB_USERNAME }}
|
||||
password: ${{ secrets.HUB_PASSWORD }}
|
||||
repository: heibai2006/webman-docker
|
||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||
|
||||
- name: Set up Docker BuildX
|
||||
uses: https://git.des8.com/docker/setup-buildx-action@v2.6.0
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ secrets.HUB_USERNAME }}/webman-docker
|
||||
|
||||
- name: Build and push
|
||||
# https://github.com/docker/build-push-action
|
||||
uses: http://git.des8.com/docker/build-push-action@master
|
||||
env:
|
||||
# 必需有且置空,查看官方文档解释:https://docs.gitea.com/zh-cn/next/usage/actions/comparison?_highlight=build&_highlight=push&_highlight=action#dockerbuild-push-actionv4
|
||||
ACTIONS_RUNTIME_TOKEN: ''
|
||||
with:
|
||||
username: ${{ secrets.HUB_USERNAME }}
|
||||
password: ${{ secrets.HUB_PASSWORD }}
|
||||
repository: heibai2006/webman-docker
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
build-args: |
|
||||
PHP_CLI_VERSION=${{ env.PHP_CLI_VERSION }}
|
||||
PHP_EXTENSION_INSTALL_VERSION=${{ env.PHP_EXTENSION_INSTALL_VERSION }}
|
||||
COMPOSER_VERSION=${{ env.COMPOSER_VERSION }}
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}
|
||||
${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}${{ github.ref_type == 'tag' && format('-{0}', github.ref_name) || '' }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
12
Dockerfile
12
Dockerfile
@ -1,18 +1,18 @@
|
||||
# https://hub.docker.com/_/php
|
||||
ARG PHP_CLI_VERSION=8.0-cli-alpine
|
||||
ARG PHP_CLI_VERSION=7.4-cli-alpine
|
||||
# https://hub.docker.com/r/mlocati/php-extension-installer
|
||||
ARG PHP_EXTENSION_INSTALL_VERSION=latest
|
||||
# https://hub.docker.com/r/composer/composer
|
||||
ARG COMPOSER_VERSION=latest
|
||||
|
||||
# 开始构建
|
||||
FROM php:$PHP_CLI_VERSION AS build
|
||||
|
||||
# install-php-extensions
|
||||
FROM mlocati/php-extension-installer:$PHP_EXTENSION_INSTALL_VERSION AS php-extension-installer
|
||||
# composer
|
||||
FROM composer/composer:$COMPOSER_VERSION AS composer
|
||||
|
||||
# 开始构建
|
||||
FROM php:$PHP_CLI_VERSION
|
||||
|
||||
# 系统依赖安装
|
||||
COPY --from=php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
@ -37,7 +37,7 @@ RUN install-php-extensions \
|
||||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
||||
COPY config/php.ini "$PHP_INI_DIR/conf.d/app.ini"
|
||||
# supervisor
|
||||
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY config/supervisord.conf /etc/supervisor/supervisord.conf
|
||||
|
||||
# 设置项目目录
|
||||
RUN mkdir -p /app
|
||||
@ -47,4 +47,4 @@ WORKDIR /app
|
||||
EXPOSE 8787
|
||||
|
||||
# 启动脚本
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||
|
17
README.md
17
README.md
@ -6,10 +6,13 @@
|
||||
|
||||
### 镜像地址和 tag
|
||||
|
||||
[docker hub](https://hub.docker.com/r/heibai2006/webman-docker)
|
||||
[docker hub](https://hub.docker.com/r/krisss/docker-webman)
|
||||
|
||||
- https://git.des8.com/heibai2006/webman-docker:8.0-cli-alpine
|
||||
- krisss/docker-webman:7.4-cli-alpine
|
||||
- krisss/docker-webman:8.0-cli-alpine
|
||||
- krisss/docker-webman:8.1-cli-alpine
|
||||
|
||||
> 此镜像会通过 github actions 动态更新 php 的小版本,镜像 tag 名不变
|
||||
|
||||
### 镜像中的组件
|
||||
|
||||
@ -21,7 +24,7 @@
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
composer require https://git.des8.com/heibai2006/webman-docker
|
||||
composer require webman-tech/docker
|
||||
```
|
||||
|
||||
会在项目根目录下提供 `Dockerfile` 用于构建镜像,提供 `docker-compose.yml` 用于开发
|
||||
@ -39,7 +42,7 @@ docker run --rm --name webman \
|
||||
-it \
|
||||
--privileged -u root \
|
||||
--entrypoint /bin/sh \
|
||||
https://git.des8.com/heibai2006/webman-docker:8.0-cli-alpine
|
||||
krisss/docker-webman:7.4-cli-alpine
|
||||
```
|
||||
|
||||
创建项目
|
||||
@ -66,7 +69,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
webman:
|
||||
image: https://git.des8.com/heibai2006/webman-docker:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
|
||||
image: krisss/docker-webman:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
|
||||
ports:
|
||||
- "${DOCKER_WEBMAN_PORT:-8787}:8787"
|
||||
volumes:
|
||||
@ -87,10 +90,10 @@ docker-compose up
|
||||
在项目下自建 `Dockerfile`,参考例子如下:
|
||||
|
||||
```Dockerfile
|
||||
ARG WEBMAN_DOCKER_VERSION=8.0-cli-alpine
|
||||
ARG WEBMAN_DOCKER_VERSION=7.4-cli-alpine
|
||||
|
||||
# https://github.com/krissss/docker-webman
|
||||
FROM heibai2006/webman-docker:$WEBMAN_DOCKER_VERSION
|
||||
FROM krisss/docker-webman:$WEBMAN_DOCKER_VERSION
|
||||
|
||||
# 增加额外的扩展
|
||||
#RUN install-php-extensions imagick
|
||||
|
@ -3,13 +3,11 @@
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"description": "docker for webman app",
|
||||
"require": {},
|
||||
"require": {
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Kriss\\WebmanDocker\\": "src"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"github-actions-date": "2024-01-01T00:52:30.495Z"
|
||||
}
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
[php]
|
||||
#max_execution_time=1800
|
||||
|
||||
[opcache]
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
|
@ -2,7 +2,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
webman:
|
||||
image: "http://git.des8.com/heibai2006/webman-docker:${PHP_CLI_VERSION}"
|
||||
image: "krisss/docker-webman:${PHP_CLI_VERSION}"
|
||||
build:
|
||||
context: "./"
|
||||
args:
|
||||
|
@ -1,8 +1,8 @@
|
||||
# 用于将项目构建成镜像
|
||||
ARG WEBMAN_DOCKER_VERSION=8.0-cli-alpine
|
||||
ARG WEBMAN_DOCKER_VERSION=7.4-cli-alpine
|
||||
|
||||
# https://github.com/krissss/docker-webman
|
||||
FROM https://git.des8.com/heibai2006/webman-docker:$WEBMAN_DOCKER_VERSION
|
||||
FROM krisss/docker-webman:$WEBMAN_DOCKER_VERSION
|
||||
|
||||
# 增加额外的扩展
|
||||
#RUN apk add --no-cache git
|
||||
|
@ -3,7 +3,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
webman:
|
||||
image: https://git.des8.com/heibai2006/webman-docker:${DOCKER_WEBMAN_VERSION:-8.0-cli-alpine}
|
||||
image: krisss/docker-webman:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
|
||||
ports:
|
||||
- "${DOCKER_WEBMAN_PORT:-8787}:8787"
|
||||
volumes:
|
||||
|
Loading…
Reference in New Issue
Block a user