git restore --source dev .

This commit is contained in:
Rodolfo Berrios
2021-08-03 12:33:53 -04:00
parent 6136184073
commit 5256b231cb
16 changed files with 297 additions and 82 deletions

View File

@@ -1,4 +1,4 @@
name: Build httpd-php
name: Build httpd-php (amd64)
on:
workflow_dispatch:
@@ -6,6 +6,8 @@ jobs:
build:
name: Build and push image
runs-on: ubuntu-20.04
env:
arch: amd64
steps:
- uses: actions/checkout@v2
@@ -25,10 +27,12 @@ jobs:
uses: redhat-actions/buildah-build@v2
with:
image: ${{ secrets.REGISTRY_IMAGE }}
tags: latest-httpd-php
tags: latest-httpd-php-${{ env.arch }}
arch: ${{ env.arch }}
dockerfiles: |
./httpd-php.Dockerfile
build-args: |
ARCH=${{ env.arch }}
CHEVERETO_LICENSE=${{ secrets.CHEVERETO_LICENSE }}
- name: Log in to container registry

59
.github/workflows/httpd-php-arm64v8.yml vendored Normal file
View File

@@ -0,0 +1,59 @@
name: Build httpd-php (arm64v8)
on:
workflow_dispatch:
jobs:
build:
name: Build and push image
runs-on: ubuntu-20.04
env:
arch: arm64v8
steps:
- uses: actions/checkout@v2
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Checkout custom application
env:
REPO_CUSTOM_APP: ${{ secrets.REPO_APP }}
if: env.REPO_CUSTOM_APP != null
uses: actions/checkout@v2
with:
repository: ${{ secrets.REPO_APP }}
token: ${{ secrets.REPO_APP_ACCESS_TOKEN }}
path: chevereto
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ secrets.REGISTRY_IMAGE }}
tags: latest-httpd-php-${{ env.arch }}
arch: ${{ env.arch }}
dockerfiles: |
./httpd-php.Dockerfile
build-args: |
ARCH=${{ env.arch }}
CHEVERETO_LICENSE=${{ secrets.CHEVERETO_LICENSE }}
- name: Log in to container registry
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ${{ secrets.REGISTRY_LABEL }}
- name: Push to container registry
id: push-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ secrets.REGISTRY_LABEL }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"

View File

@@ -1,8 +1,8 @@
name: Update template
name: Update
on:
workflow_dispatch:
jobs:
update-template:
update:
runs-on: ubuntu-20.04
steps:
- name: Checkout

View File

@@ -14,6 +14,4 @@ The build process consist in build the container image that you will use to depl
## Manual building
```sh
docker build -t tag . -f httpd-php.Dockerfile --build-arg CHEVERETO_LICENSE=<license>
```
Refer to the [MANUAL GUIDE](guides/console/BUILDING.md).

View File

@@ -21,7 +21,4 @@ Dockerfile template project for building and distributing container images for C
* [SETUP](SETUP.md)
* [BUILDING](BUILDING.md)
* [UPDATING](UPDATING.md)
## Guides
* [Portainer](guides/portainer/README.md)
* [GUIDES](guides/README.md)

View File

@@ -5,7 +5,7 @@ The update process consist in that you pull our `chevereto/container-builder` re
## One-click updating
1. Go to **Actions**
2. Select **Update template** under **Workflows**
2. Select **Update** under **Workflows**
3. Click on **Run Workflow** and confirm
![Update template](src/update.png)
@@ -16,21 +16,4 @@ The update process consist in that you pull our `chevereto/container-builder` re
## Manual updating
* Add the main template repository as remote `template`. This is required just once.
```sh
git remote add template https://github.com/chevereto/container-builder
```
* Fetch `template` and merge it with `main`. This will pull all updates.
```sh
git fetch template main
git merge template/main --allow-unrelated-histories
```
* When done push the changes to your remote repository.
```sh
git push
```
Refer to the [MANUAL GUIDE](guides/console/UPDATING.md).

View File

@@ -17,7 +17,7 @@ services:
MYSQL_PASSWORD: user_database_password
chv-build:
image: rodber/docker-build:latest-httpd-php
image: chevereto-build:latest-httpd-php-amd64
networks:
- chv-network
volumes:

View File

@@ -0,0 +1,46 @@
version: "3"
services:
chv-database:
image: mariadb:focal
networks:
- chv-network
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping --silent"]
volumes:
- chv-data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: chevereto
MYSQL_USER: chevereto
MYSQL_PASSWORD: user_database_password
chv-build:
image: chevereto-build:latest-httpd-php-arm64v8
networks:
- chv-network
volumes:
- chv-storage:/var/www/html/images/
- chv-assets:/var/www/html/_assets/
ports:
- 8016:80
restart: always
environment:
CHEVERETO_DB_HOST: chv-database
CHEVERETO_DB_USER: chevereto
CHEVERETO_DB_PASS: user_database_password
CHEVERETO_DB_PORT: 3306
CHEVERETO_DB_NAME: chevereto
CHEVERETO_HTTPS: 0
CHEVERETO_ASSET_STORAGE_TYPE: local
CHEVERETO_ASSET_STORAGE_URL: http://localhost:8016/_assets/
CHEVERETO_ASSET_STORAGE_BUCKET: /var/www/html/_assets/
volumes:
chv-data:
chv-assets:
chv-storage:
networks:
chv-network:

6
guides/README.md Normal file
View File

@@ -0,0 +1,6 @@
# Guides
For all purposes, the [docker-compose](../docker-compose/) folder contains examples on running using `docker-compose.yml` files.
* [Portainer](portainer/README.md)
* [Console](console/README.md)

View File

@@ -0,0 +1,21 @@
# Building (console)
> Note: Running the command from the top folder of this repository.
* **amd64**
```sh
docker build -t chevereto-build:latest-httpd-php-amd64 . \
-f httpd-php.Dockerfile \
--build-arg CHEVERETO_LICENSE=<license> \
--build-arg ARCH=amd64
```
* **arm64v8**
```sh
docker build -t chevereto-build:latest-httpd-php-arm64v8 . \
-f httpd-php.Dockerfile \
--build-arg CHEVERETO_LICENSE=<license> \
--build-arg ARCH=arm64v8
```

7
guides/console/README.md Normal file
View File

@@ -0,0 +1,7 @@
# Console
This section outlines command-line instructions to build and deploy images made by ths repository project.
* [SETUP](SETUP.md)
* [BUILDING](BUILDING.md)
* [UPDATING](UPDATING.md)

11
guides/console/SETUP.md Normal file
View File

@@ -0,0 +1,11 @@
# Setup (console)
* Clone the repository
```sh
git clone https://github.com/chevereto/container-builder.git
```
## Custom application
Put the contents of your custom Chevereto based application in the `/chevereto` folder before building the image.

View File

@@ -0,0 +1,20 @@
# Updating (console)
* Add the main template repository as remote `template`. *This is required just once*.
```sh
git remote add template https://github.com/chevereto/container-builder
```
* Fetch `template` and merge it with `main`. This will pull all updates.
```sh
git fetch template main
git merge template/main --allow-unrelated-histories
```
* When done push the changes to your remote repository.
```sh
git push
```

View File

@@ -0,0 +1,81 @@
# Docker compose
> Run all the following commands from the top folder of this repository.
Refer to [docker-compose/](../../docker-compose/) directory for all the compose files examples you can use.
## Up
Run Chevereto, it will be available at [https://localhost:8096](https://localhost:8096) by default:
* **arm64v8**
```sh
docker compose \
-f docker-compose/httpd-php-arm64v8.yml \
up -d
```
* **amd64**
```sh
docker compose \
-f docker-compose/httpd-php-amd64.yml \
up -d
```
## Stop
* **arm64v8**
```sh
docker compose \
-f docker-compose/httpd-php-arm64v8.yml \
stop
```
* **amd64**
```sh
docker compose \
-f docker-compose/httpd-php-amd64.yml \
stop
```
## Start
* **arm64v8**
```sh
docker compose \
-f docker-compose/httpd-php-arm64v8.yml \
start
```
* **amd64**
```sh
docker compose \
-f docker-compose/httpd-php-amd64.yml \
start
```
## Down
* **arm64v8**
```sh
docker compose \
-f docker-compose/httpd-php-arm64v8.yml \
down
```
* **amd64**
```sh
docker compose \
-f docker-compose/httpd-php-amd64.yml \
down
```
**Note**: This won't remove the volumes for persistent data storage.

View File

@@ -4,38 +4,19 @@
To use Chevereto with [Portainer](https://www.portainer.io/) you need the **Chevereto image build** already made and available in the private container registry of your choice.
## Compatibility remark
**NOTE:** [Portainer CE 2.1.1](https://www.portainer.io/blog/portainer-release-2.1.1) supports docker-compose > 3 for standalone hosts ONLY for AMD64. This guide won't work when using ARM/ARM64:
> The team (Portainer) are still working on creating a standalone binary for Compose that works on ARM/ARM64
## Installation
1. Install **Portainer**
2. Once installed, go to **Registries**
3. Add the user credentials for your **container registry**
1. Install **Portainer** following the instructions for your system.
## docker-compose
If you are using a remote container registry such as Docker hub and others:
Build your own `docker-compose` file by grabbing [httpd-php.dist.yml](./httpd-php.dist.yml) and change:
```yml
chv-build:
image: rodber/docker-build:latest-httpd-php
```
To this, where `your_image_here` references your private image tag.
```yml
chv-build:
image: your_image_here
```
You may alter the default provisioning to change HTTPS behavior, set a external storage provider for assets, etc. By default this guide only uses local volumes.
1. Go to **Registries**
2. Add the user credentials for your **container registry**
## Adding Chevereto as a Portainer custom application
**NOTE:** [Portainer CE 2.1.1](https://www.portainer.io/blog/portainer-release-2.1.1) supports docker-compose > 3 for standalone hosts **ONLY for amd64** architecture. This guide won't work when using arm64, for which case you can manually run `docker compose` following our [MANUAL GUIDE](../manual/README.md).
1. Open Portainer and go to endpoint **Dashboard**
2. Go to **App Templates** and then click on **Custom Templates**
3. Click on **Add Custom Template**
@@ -50,6 +31,27 @@ You may alter the default provisioning to change HTTPS behavior, set a external
When done, Chevereto will be available in the custom applications list.
### docker-compose
* [httpd-php-amd64.dist.yml](../docker-compose/httpd-php-amd64.dist.yml)
* [httpd-php-arm64v8.dist.yml](../docker-compose/httpd-php-arm64v8.dist.yml)
If you want to use a custom image tag or registry change:
```yml
chv-build:
image: chevereto-build:latest-httpd-php-amd64
```
To this, where `your_image_here` references your private image tag.
```yml
chv-build:
image: your_image_here
```
You may alter the default provisioning to change HTTPS behavior, set a external storage provider for assets, etc. By default this guide only uses local volumes.
## Deploying
1. Go to **Custom Templates**, click **Chevereto**
@@ -94,27 +96,6 @@ drwxr-xr-x 6 www-data www-data 4096 Jun 23 16:47 importing
drwxr-xr-x 4 www-data www-data 4096 Jun 23 15:13 lib
drwxr-xr-x 2 www-data www-data 4096 Jun 23 15:13 sdk
```
### Multiple instances
To deploy multiple instances using Portainer:
1. Go to **Custom Templates**, click **Chevereto**
2. Choose your deploy options
3. Click **Customize stack** and **change port `8016` references** to another port in your host machine
4. Finish by clicking on **Deploy the stack**
`docker-compose` port `8016` references:
```yaml
ports:
- 8016:80
```
```yaml
CHEVERETO_ASSET_STORAGE_URL: http://localhost:8016/_assets/
```
## Updating
You will need to [update your template](../../UPDATING.md) then [re-create the build](../../BUILDING.md).

View File

@@ -1,4 +1,7 @@
FROM php:7.4-apache
ARG ARCH
FROM docker.io/$ARCH/composer:latest as base
FROM docker.io/$ARCH/php:7.4-apache
COPY --from=base /usr/bin/composer /usr/local/bin/composer
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
@@ -20,8 +23,6 @@ RUN apt-get update && apt-get install -y \
&& php -m \
&& a2enmod rewrite
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
ARG CHEVERETO_SOFTWARE=chevereto
ARG CHEVERETO_TAG=3.20.10
ARG CHEVERETO_INSTALLER_TAG=2.3.0
@@ -53,8 +54,8 @@ ENV CHEVERETO_SOFTWARE=$CHEVERETO_SOFTWARE \
CHEVERETO_HOSTNAME_PATH=/ \
CHEVERETO_SESSION_SAVE_HANDLER=files \
CHEVERETO_SESSION_SAVE_PATH=/tmp \
CHEVERETO_UPLOAD_MAX_FILESIZE=25M \
CHEVERETO_POST_MAX_SIZE=25M \
CHEVERETO_UPLOAD_MAX_FILESIZE=64M \
CHEVERETO_POST_MAX_SIZE=64M \
CHEVERETO_MAX_EXECUTION_TIME=30 \
CHEVERETO_MEMORY_LIMIT=512M \
CHEVERETO_ASSET_STORAGE_NAME=assets \