Skip to content
Merged
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
3 changes: 2 additions & 1 deletion docker-compose.yml.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
laravel.test:
build:
Expand All @@ -19,8 +18,10 @@ services:
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
IGNITION_LOCAL_SITES_PATH: '${PWD}'
volumes:
- '.:/var/www/html'
- './docker/8.3/nginx.conf:/etc/nginx/sites-available/default'
networks:
- sail
depends_on:
Expand Down
64 changes: 39 additions & 25 deletions docker/8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,66 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

LABEL maintainer="Fossil01"

ARG WWWGROUP
ARG NODE_VERSION=20
ARG POSTGRES_VERSION=15
ARG NODE_VERSION=21
ARG POSTGRES_VERSION=16
ARG SEVENZIP_VERSION=2407
ARG MYSQL_CLIENT="mariadb-client"

WORKDIR /var/www/html

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update \
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip unrar git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils \
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip unrar 7zip lame git supervisor sqlite3 libcap2-bin libpng-dev python3 dnsutils \
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu noble main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/nginx/ubuntu noble main" > /etc/apt/sources.list.d/ppa_ondrej_nginx.list \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \
&& echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \
&& echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get install -y php8.3-cli php8.3-dev \
php8.3-pgsql php8.3-sqlite3 php8.3-gd php8.3-imagick \
php8.3-curl \
php8.3-imap php8.3-mysql php8.3-mbstring \
php8.3-xml php8.3-zip php8.3-bcmath php8.3-soap \
php8.3-intl php8.3-readline \
php8.3-ldap \
php8.3-msgpack php8.3-igbinary php8.3-redis php8.3-swoole \
php8.3-memcached php8.3-pcov php8.3-xdebug \
tmux iputils-ping net-tools libmediainfo0v5 mediainfo libzen0v5 ffmpeg \
sudo jq htop fonts-powerline nano bash-completion time wget cron \
nginx php8.3-fpm \
jpegoptim webp optipng pngquant libavif-bin \
&& apt-get install -y php8.3 php8.3-cli php8.3-common php8.3-mysql php8.3-xdebug php8.3-dev \
php8.3-amqp php8.3-bcmath php8.3-bz2 php8.3-curl php8.3-gd php8.3-gmp php8.3-gnupg \
php8.3-http php8.3-igbinary php8.3-imagick php8.3-intl php8.3-mbstring php8.3-msgpack \
php8.3-oauth php8.3-opcache php8.3-raphf php8.3-readline php8.3-redis php8.3-soap php8.3-sqlite3 \
php8.3-swoole php8.3-tidy php8.3-uploadprogress php8.3-uuid php8.3-xml php8.3-xmlrpc php8.3-xsl \
php8.3-yaml php8.3-zip php8.3-zstd php8.3-pgsql php8.3-sockets php8.3-imap php8.3-ldap php8.3-memcached php8.3-pcov \
tmux iputils-ping net-tools ffmpeg \
sudo jq htop fonts-powerline nano bash-completion time wget cron \
nginx php8.3-fpm libnginx-mod-brotli \
jpegoptim webp optipng pngquant libavif-bin \
&& wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-24_all.deb \
&& dpkg -i repo-mediaarea_1.0-24_all.deb \
&& apt-get update \
&& apt-get install -y libmediainfo0v5 mediainfo libzen0v5 \
&& curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
&& curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm \
&& apt-get install -y yarn \
&& apt-get install -y mysql-client \
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
&& npm install -g npm bun pnpm \
&& apt-get install -y yarn $MYSQL_CLIENT postgresql-client-$POSTGRES_VERSION \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.3
# Determine ARCH and download and extract the appropriate version of 7-Zip
RUN ARCH="$(dpkg --print-architecture)" && \
if [ "$ARCH" = "amd64" ]; then \
SZIP_URL="https://www.7-zip.org/a/7z$SEVENZIP_VERSION-linux-x64.tar.xz"; \
fi && \
if [ "$ARCH" = "arm64" ]; then \
SZIP_URL="https://www.7-zip.org/a/7z2407-linux-arm64.tar.xz"; \
fi && \
wget "$SZIP_URL" -O /tmp/7z.tar.xz && \
tar -xf /tmp/7z.tar.xz -C /tmp/ && \
mv /tmp/7zz /usr/bin/7zz && \
rm -f /tmp/7z.tar.xz && rm -f /tmp/7zzs

RUN groupadd --force -g $WWWGROUP sail
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
RUN echo "alias artisan=\"php artisan\"" >> /home/sail/.bashrc

COPY scheduler /etc/cron.d/scheduler
RUN chmod 0644 /etc/cron.d/scheduler \
Expand All @@ -62,4 +76,4 @@ RUN chmod +x /usr/local/bin/start-container
EXPOSE 80

#ENTRYPOINT ["tail", "-f", "/dev/null"] # Use only for debugging
ENTRYPOINT ["start-container"]
ENTRYPOINT ["start-container"]
8 changes: 6 additions & 2 deletions docker/8.3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

**Author:** [Fossil01](https://github.com/Fossil01)

The development environment contains the: App, MariaDB, Redis, Manticore and Mailpit containers. The app container is where nginx and PHP-FPM run and has a bind mount to the root directory of this project. Supervisord is used to run it all in the background. Manticore can be switched out for Elasticsearch by commenting/uncommenting the corresponding lines in `docker-compose.yml`. Elasticsearch has security disabled by default.
### Caution: This setup is intended solely for development use. For production deployments, it is recommended to construct your own Docker containers.

This development environment is composed of several key containers: App, MariaDB, Redis, Manticore, and Mailpit. The App container hosts nginx and PHP-FPM, and includes a bind mount that links to the root directory of this project. Supervisord is utilized to manage these services in the background.

For search capabilities, Manticore is the default setup, but you can easily switch to Elasticsearch by modifying the corresponding lines in the docker-compose.yml file. Note that Elasticsearch is configured with security features disabled by default.

This container also houses several tools to run the indexing backend: tmux, ffmpeg, mediainfo, unrar etc. It also has MariaDB & Postgres clients, NodeJS & Yarn.

nginx runs on port 80 and is mapped to port 80 on the host machine too. If you're already using port 80 then change the `docker-compose.yml` file accordingly.

Mailpit is used as a fake mailserver which catches all e-mails in one inbox. You can acess this via [this link](http://localhost:8025). Mailpit's SMTP server runs on port `1025`.

>This project currently uses PHP 8.3 and MariaDB 10.x
> This project currently uses PHP 8.3 and MariaDB 11.x

## Prerequisites

Expand Down
15 changes: 13 additions & 2 deletions docker/8.3/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@ server {
charset utf-8;

gzip on;
gzip_types text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/xml application/xml+rss application/atom+xml image/x-icon font/opentype application/json;
gzip_types text/plain text/xml text/css text/html application/x-javascript text/javascript application/javascript application/xml application/xml+rss application/atom+xml image/x-icon font/opentype application/json;
gzip_min_length 256;
gzip_vary on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_proxied any;
gzip_comp_level 6;

# Only works on secured connections
brotli on;
brotli_comp_level 6;
brotli_static on;
brotli_types application/atom+xml application/javascript application/json application/rss+xml
application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype
application/x-font-ttf application/x-javascript application/xhtml+xml application/xml
font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon
image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml text/html;

location / {
try_files $uri $uri/ /index.php?$query_string;
Expand All @@ -35,4 +46,4 @@ server {
location ~ /\.ht {
deny all;
}
}
}