This commit is contained in:
Roman Kelesidis 2025-08-11 07:15:35 +00:00 committed by GitHub
commit fc65db3d42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 173 additions and 0 deletions

74
.dockerignore Normal file
View file

@ -0,0 +1,74 @@
### GitHub ###
.git
.github
### IDE ###
.idea
### TorrentPier ###
*.log
*.integrity
.env
.php_cs.cache
#-- data folder
##-> avatats
data/avatars
!data/avatars/gallery/bot.gif
!data/avatars/gallery/noavatar.png
##-> uploads
data/uploads
!data/uploads/.htaccess
!data/uploads/thumbs/.keep
#-- internal_data folder
##-> atom
internal_data/atom
!internal_data/atom/.keep
##-> cache
internal_data/cache
!internal_data/cache/.htaccess
##-> log
internal_data/log
!internal_data/log/.htaccess
##-> triggers
internal_data/triggers
!internal_data/triggers/.htaccess
!internal_data/triggers/$on
##-> updater.json
internal_data/updater.json
#-- sitemap
sitemap
!sitemap/.keep
#-- other
library/config.local.php
vendor
### Archives ###
*.phar
*.rar
*.tar
*.gz
*.zip
*.7z
*.torrent
*.pak
### Windows ###
Thumbs.db
Desktop.ini
$RECYCLE.BIN/
*.lnk
*.bat
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
._*
.Spotlight-V100
.Trashes
*.orig
*.rej
### Docker ###
docker-compose.override.yml
docker-compose.yml

3
.gitignore vendored
View file

@ -45,3 +45,6 @@ $RECYCLE.BIN/
.Trashes
*.orig
*.rej
### Docker ###
docker-compose.override.yml

72
Dockerfile Normal file
View file

@ -0,0 +1,72 @@
FROM php:8.1-apache
LABEL maintainer="TorrentPier <admin@torrentpier.com>"
# Enable Apache mod_rewrite
RUN a2enmod rewrite
# Install GD2
RUN apt-get update && apt-get install -y --no-install-recommends --allow-downgrades \
libfreetype6-dev \
libjpeg62-turbo-dev \
libonig-dev \
libz-dev \
zlib1g-dev \
libpng-dev && \
docker-php-ext-configure gd --with-freetype --with-jpeg && \
docker-php-ext-install -j$(nproc) gd && \
rm -rf /var/lib/apt/lists/*
# Install mysqli
RUN docker-php-ext-install mysqli
# Install mbstring
RUN docker-php-ext-install mbstring
# Install bcmath
RUN docker-php-ext-install bcmath
# Install zip & unzip
RUN apt-get update && apt-get install -y \
libzip-dev \
unzip && \
docker-php-ext-install zip && \
rm -rf /var/lib/apt/lists/*
# Install intl
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
libicu-dev \
zlib1g-dev && \
docker-php-ext-configure intl && \
docker-php-ext-install intl && \
rm -rf /var/lib/apt/lists/*
# Custom php.ini settings
COPY docker/php/php.ini ${PHP_INI_DIR}/php.ini
# Install composer
RUN curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/bin/ --filename=composer
# Set the work directory to /var/www/html so all subsequent commands in this file start from that directory.
# Also set this work directory so that it uses this directory everytime we use docker exec.
WORKDIR /var/www/html
# Install the composer dependencies (no autoloader yet as that invalidates the docker cache)
COPY composer.json ./
COPY composer.lock ./
RUN composer install --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress && \
composer clear-cache
# Bundle source code into container. Important here is that copying is done based on the rules defined in the .dockerignore file.
COPY . /var/www/html
# Dump the autoloader
RUN composer dump-autoload --optimize --classmap-authoritative --no-dev
# Give apache write access to host
RUN chown -R www-data:www-data /var/www/html
# This specifies on which port the application will run. This is pure communicative and makes this 12 factor app compliant
# (see https://12factor.net/port-binding).
EXPOSE 80 443

22
docker-compose.yml Normal file
View file

@ -0,0 +1,22 @@
version: '3.8'
services:
torrentpier:
build: .
container_name: torrentpier
ports:
- "80:80"
- "443:443"
depends_on:
- db
db:
image: mariadb:latest
container_name: mariadb
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: super_password
MYSQL_DATABASE: database
MYSQL_USER: username
MYSQL_PASSWORD: password

1
docker/nginx/nginx.conf Normal file
View file

@ -0,0 +1 @@

1
docker/php/php.ini Normal file
View file

@ -0,0 +1 @@