diff --git a/docker-compose/httpd-php.dist.yml b/docker-compose/httpd-php.dist.yml new file mode 100644 index 0000000..26518bb --- /dev/null +++ b/docker-compose/httpd-php.dist.yml @@ -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: rodber/docker-build:latest-httpd-php + 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: diff --git a/guides/portainer.md b/guides/portainer.md new file mode 100644 index 0000000..359e4f9 --- /dev/null +++ b/guides/portainer.md @@ -0,0 +1,72 @@ +# Portainer + +## Requirements + +To use this system with [Portainer](https://www.portainer.io/) you need the Chevereto image build already made and available in the private container registry of your choice. + +## Installation + +1. Install Portainer +2. Once installed, go to **Registries** +3. Add the user credentials for your container registry + +## Chevereto in Portainer + +### docker-compose + +Build your own `docker-compose` file by grabbing [httpd-php.dist.yml](../docker-compose/httpd-php.dist.yml) and change: + +```yml + chv-build: + image: rodber/docker-build:latest-httpd-php +``` + +To this: + +```yml + chv-build: + image: your_image_here +``` + +### Adding Chevereto as a Portainer custom application + +1. Go to **App Templates** and then click on **Custom Templates** +1. Click on **Add Custom Template** +2. Fill the required information + 1. Title: Chevereto + 2. Description: My Chevereto + 3. Icon URL: `https://chevereto.com/src/icons/logo.svg` + 4. Platform: **Linux** + 5. Type: **Standalone** +3. **Under Build method** select **Web editor** and provide your [docker-compose](#docker-compose) file contents +4. Finish by clicking on **Create custom template** + +When done, Chevereto will be available in the custom applications list. + +### Deploying Chevereto in Portainer + +1. Go to **Custom Templates**, click **Chevereto** +2. Choose your deploy options +3. Finish by clicking on **Deploy the stack** + +## Volumes & Permissions + +| Volume | Mount path | Purpose | +| ----------- | ---------------------- | ------------------------------------ | +| chv-storage | /var/www/html/images/ | User uploads | +| chv-assets | /var/www/html/_assets/ | Website assets (avatars, logos, etc) | + +Permissions in the mount path must be `www-data:www-data` + +### `chv-storage` + +This volume is used to store user uploaded images in the same filesystem where Chevereto is running. This is used when you don't add any External Storage provider to Chevereto. + +### `chv-assets` + +This volume is used to store the Chevereto assets namely user avatars, website logos, background images, etc. This is used when you configure asset storage for use the `local` External Storage API. + +## Useful links + +* Chevereto [Environment](https://v3-docs.chevereto.com/setup/system/environment.html) +* Chevereto [External Storage](https://v3-docs.chevereto.com/features/integrations/external-storage.html) diff --git a/httpd-php.Dockerfile b/httpd-php.Dockerfile index 4352d93..e40d1a3 100644 --- a/httpd-php.Dockerfile +++ b/httpd-php.Dockerfile @@ -58,7 +58,7 @@ ENV CHEVERETO_SOFTWARE=$CHEVERETO_SOFTWARE \ CHEVERETO_ASSET_STORAGE_NAME=assets \ CHEVERETO_ASSET_STORAGE_TYPE=local \ CHEVERETO_ASSET_STORAGE_KEY= \ - CHEVERETO_ASSET_STORAGE_SECRET= \ + CHEVERETO_ASSET_STORAGE_SECRET=/var/www/html/_assets/ \ CHEVERETO_ASSET_STORAGE_BUCKET= \ CHEVERETO_ASSET_STORAGE_URL= \ CHEVERETO_ASSET_STORAGE_REGION= \ @@ -82,6 +82,7 @@ RUN mkdir -p /var/www/html/importing && \ mkdir -p /var/www/html/importing/parse-album && \ mkdir -p /var/www/html/importing/parse-users +VOLUME /var/www/html/_assets VOLUME /var/www/html/images VOLUME /var/www/html/importing VOLUME /var/www/html/importing/no-parse