diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml new file mode 100644 index 0000000..77c73de --- /dev/null +++ b/.github/workflows/laravel.yml @@ -0,0 +1,32 @@ +on: push +name: Build +jobs: + deploy: + name: Build Laravel Images + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: bpkg.io + username: k3s + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push bpkg.io/laravel:8.0-octane + uses: docker/build-push-action@v2 + with: + context: . + file: ./runtimes/laravel:8.0-octane/Dockerfile + platforms: | + linux/amd64 + linux/arm/v7 + push: true + build-args: | + CICD_GIT_COMMIT=${{ steps.slug.outputs.sha8 }} + tags: | + bpkg.io/laravel:latest + bpkg.io/laravel:8.0-octane diff --git a/runtimes/laravel:8.0-octane/Dockerfile b/runtimes/laravel:8.0-octane/Dockerfile new file mode 100644 index 0000000..b8ce1e8 --- /dev/null +++ b/runtimes/laravel:8.0-octane/Dockerfile @@ -0,0 +1,20 @@ +FROM php:8.0-cli-alpine3.13 + +WORKDIR /var/www/html + +# STSTEM: Install required packages +RUN apk --no-cache upgrade && \ + apk --no-cache add bash git sudo openssh libxml2-dev postgresql-dev oniguruma-dev autoconf gcc g++ make npm freetype-dev libjpeg-turbo-dev libpng-dev libzip-dev + +# COMPOSER: install binary and prestissimo +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer + +# PHP: install extensions +RUN pecl channel-update pecl.php.net +RUN pecl install ssh2 swoole +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install mbstring xml pcntl gd zip sockets pdo pdo_pgsql pdo_mysql bcmath +RUN docker-php-ext-enable mbstring xml gd zip swoole pcntl sockets bcmath pdo pdo_pgsql pdo_mysql + +EXPOSE 8000 +CMD ["php","artisan","octane:start", "--host=0.0.0.0"]