Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
schedule:
- cron: '41 14 * * *'
push:
branches: [ "master" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "master" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: docker.io
# github.repository as <account>/<repo>
IMAGE_NAME: zimmermannmaxim/tastyigniter
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't be able to push to your repo



jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
with:
cosign-release: 'v2.2.4'

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
15 changes: 7 additions & 8 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
68 changes: 34 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
FROM php:7.4-apache
FROM php:8.3-apache

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
apt-get install -y \
unzip \
openssl \
libcurl4-openssl-dev \
libjpeg-dev \
libpng-dev \
libmcrypt-dev \
libxml2-dev \
libonig-dev \
libzip-dev \
; \
rm -rf /var/lib/apt/lists/*; \
\
docker-php-ext-configure gd --with-jpeg=/usr; \
docker-php-ext-install -j$(nproc) pdo_mysql curl dom gd mbstring json tokenizer zip exif
apt-get update; \
apt-get install -y \
unzip \
openssl \
libcurl4-openssl-dev \
libjpeg-dev \
libpng-dev \
libxml2-dev \
libonig-dev \
libzip-dev \
libicu-dev \
; \
rm -rf /var/lib/apt/lists/*; \
\
docker-php-ext-configure gd --with-jpeg=/usr; \
docker-php-ext-install -j$(nproc) pdo_mysql curl xml gd mbstring intl zip exif

RUN pecl install -o -f redis \
&& rm -rf /tmp/pear \
Expand All @@ -27,32 +25,34 @@ RUN pecl install -o -f redis \
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

RUN a2enmod rewrite

VOLUME /var/www/html
RUN echo "ServerName tasty" > /etc/apache2/conf-available/servername.conf && \
a2enconf servername

ENV TASTYIGNITER_VERSION 3.4.0
ENV TASTYIGNITER_VERSION 4.0.1

RUN set -ex; \
curl -o tastyigniter.zip -fSL "https://codeload.github.com/tastyigniter/TastyIgniter/zip/v${TASTYIGNITER_VERSION}"; \
unzip tastyigniter.zip -d /usr/src/; \
rm tastyigniter.zip; \
mv /usr/src/TastyIgniter-${TASTYIGNITER_VERSION} /usr/src/tastyigniter
curl -o tastyigniter.zip -fSL "https://codeload.github.com/tastyigniter/TastyIgniter/zip/v${TASTYIGNITER_VERSION}"; \
unzip tastyigniter.zip -d /usr/src/; \
rm tastyigniter.zip; \
mv /usr/src/TastyIgniter-${TASTYIGNITER_VERSION} /usr/src/tastyigniter

COPY .htaccess /usr/src/tastyigniter/

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
cd /usr/src/tastyigniter && composer install
cd /usr/src/tastyigniter && composer install --no-interaction

COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh

ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["apache2-foreground"]
CMD ["apache2-foreground"]
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
# TastyIgniter Docker
[![Docker Pulls](https://img.shields.io/docker/pulls/thisisqasim/tastyigniter)](https://hub.docker.com/r/thisisqasim/tastyigniter/)
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/thisisqasim/tastyigniter/latest)](https://hub.docker.com/r/thisisqasim/tastyigniter/tags)

Run with docker compose for automatic database configuration

```sh
git clone https://github.com/Verve-IT-Solutions/TastyIgniterDocker.git
cd TastyIgniterDocker
```
mkdir tastyigniter && cd tastyigniter
curl -LO https://github.com/ThisIsQasim/TastyIgniter/raw/master/docker-compose.yml
change the needed settings in the docker-compose using `nano docker-compose.yml`
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let people use their preferred text editor

Suggested change
change the needed settings in the docker-compose using `nano docker-compose.yml`
change the needed settings in the `docker-compose.yml` file

```sh
docker compose up db -d
sleep 10
docker compose up -d
docker compose exec app php artisan igniter:passwd admin
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this no longer needed?

docker compose up --build -d
```

Browse to port 8001 of your docker host. Use the `/admin` page to set up the admin and insert the general info

## Full reset
**This will remove everything and is only recommended for development**
```sh
docker compose down -v --remove-orphans
rm -rf db
docker volume prune -f
docker compose up db -d
sleep 10
docker compose up --build -d
```

Browse to port 8001 of your docker host. The TastyIgniter setup wizard will show up. Wait for a minute for the database container to come up and then run the setup.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the setup no longer needed as well?


## Credits
TastyIgniter: https://github.com/tastyigniter/TastyIgniter
TastyIgniter: https://github.com/tastyigniter/TastyIgniter
27 changes: 18 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
version: '2'
version: '3.8'

services:
app:
image: thisisqasim/tastyigniter:3.4.0
build: . # Build from local Dockerfile
hostname: tasty
ports:
- 8001:80
volumes:
- ./media:/var/www/persistent-media:rw
environment:
- APP_URL=https://tasty.example.com
- APP_ENV=production
- APP_URL=http://127.0.0.1:8001 #CHANGEME
# Replace with your server's public IP address
- DB_CONNECTION=mysql
- DB_HOST=db
- DB_DATABASE=tastyigniter
- DB_USERNAME=tastyigniter
- DB_PASSWORD=somepassword
- DB_PASSWORD=securefassword #CHANGEME
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- DB_PASSWORD=securefassword #CHANGEME
- DB_PASSWORD=securepassword #CHANGEME

# Replace with your database password
- CACHE_DRIVER=redis
- REDIS_HOST=redis
restart: always
restart: always
db:
image: mariadb:10.7
image: mariadb:10.11
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=tastyigniter
- MYSQL_USER=tastyigniter
- MYSQL_PASSWORD=somepassword
- MYSQL_PASSWORD=securefassword #CHANGEME
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- MYSQL_PASSWORD=securefassword #CHANGEME
- MYSQL_PASSWORD=securepassword #CHANGEME

# Replace with your database password
# Has to be the same as in the app service
restart: always

redis:
image: redis:6
image: redis:7
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru
restart: always
restart: always
Loading