mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
feat: Added Docker support
This commit is contained in:
parent
36837f4bc9
commit
8440ecd29b
2 changed files with 71 additions and 0 deletions
35
Dockerfile
Normal file
35
Dockerfile
Normal file
|
@ -0,0 +1,35 @@
|
|||
FROM dunglas/frankenphp:1-php8.4
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
cron \
|
||||
libicu-dev \
|
||||
libtidy-dev \
|
||||
libjpeg-dev \
|
||||
libpng-dev \
|
||||
libfreetype6-dev \
|
||||
libxml2-dev \
|
||||
libzip-dev \
|
||||
&& docker-php-ext-install -j$(nproc) \
|
||||
mysqli \
|
||||
mbstring \
|
||||
gd \
|
||||
bcmath \
|
||||
intl \
|
||||
tidy \
|
||||
xml \
|
||||
xmlwriter \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
RUN echo "*/10 * * * * php /app/cron.php >> /var/log/cron.log 2>&1" > /etc/cron.d/app-cron \
|
||||
&& chmod 0644 /etc/cron.d/app-cron \
|
||||
&& crontab /etc/cron.d/app-cron \
|
||||
&& touch /var/log/cron.log
|
||||
|
||||
COPY install/Caddyfile /etc/caddy/Caddyfile
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
CMD service cron start && frankenphp run --config /etc/caddy/Caddyfile
|
36
docker-compose.yml
Normal file
36
docker-compose.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
version: "3.9"
|
||||
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
container_name: php-app
|
||||
ports:
|
||||
- "${TP_PORT}:80"
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./:/app
|
||||
- ./internal_data:/app/internal_data
|
||||
- ./data:/app/data
|
||||
- ./sitemap:/app/sitemap
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: mariadb:10.11
|
||||
container_name: db
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
|
||||
MYSQL_DATABASE: ${DB_DATABASE}
|
||||
MYSQL_USER: ${DB_USERNAME}
|
||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||
ports:
|
||||
- "${DB_PORT}:3306"
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
|
||||
volumes:
|
||||
db_data:
|
Loading…
Add table
Add a link
Reference in a new issue