Move docker to a separate repository

This commit is contained in:
Darko Gjorgjijoski
2024-01-30 07:49:00 +02:00
parent a85c682bcb
commit 89f6f02d1f
10 changed files with 2 additions and 156 deletions

View File

@@ -1,51 +0,0 @@
FROM php:8.1-fpm-bookworm
ENV user=invoiceshelf-user
ENV uid=1000
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
libmagickwand-dev \
nano \
mariadb-client
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pecl install imagick \
&& docker-php-ext-enable imagick
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl bcmath gd
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
COPY . /var/www/
COPY docker/php/uploads.ini /usr/local/etc/php/conf.d/uploads.ini
RUN cp /var/www/.env.example /var/www/.env
RUN chown -R $user:$user /var/www/
RUN chmod -R 775 /var/www/storage
RUN chmod -R 775 /var/www/bootstrap
# Set working directory
WORKDIR /var/www
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
RUN php artisan key:generate
RUN php artisan storage:link || true
USER $user

View File

@@ -1,10 +0,0 @@
FROM php:8.1-fpm-bookworm
RUN apt update && apt install -y cron
RUN docker-php-ext-install pdo pdo_mysql bcmath
COPY docker/crontab /etc/crontabs/root
RUN crontab /etc/crontabs/root
CMD ["/usr/sbin/cron", "-f"]

View File

@@ -1 +0,0 @@
* * * * * cd /var/www && php artisan schedule:run >> /dev/stdout 2>&1

View File

@@ -1,52 +0,0 @@
version: '3'
services:
app:
image: invoiceshelf/invoiceshelf-php
restart: unless-stopped
working_dir: /var/www/
networks:
- invoiceshelf
db:
image: mariadb:lts
restart: always
volumes:
- db:/var/lib/mysql
# If you want to persist data on the host, comment the line above this one...
# and uncomment the line under this one.
#- ./docker-compose/db/data:/var/lib/mysql:rw,delegated
environment:
MYSQL_USER: invoiceshelf
MYSQL_PASSWORD: invoiceshelf
MYSQL_DATABASE: invoiceshelf
MYSQL_ROOT_PASSWORD: invoiceshelf
ports:
- '33006:3306'
networks:
- invoiceshelf
nginx:
image: invoiceshelf/invoiceshelf-nginx
restart: unless-stopped
ports:
- 80:80
networks:
- invoiceshelf
cron:
build:
context: ../
dockerfile: docker/cron.dockerfile
image: invoiceshelf-cron
volumes:
- ../:/var/www
networks:
- invoiceshelf
volumes:
db:
networks:
invoiceshelf:
driver: bridge

View File

@@ -1,5 +0,0 @@
FROM nginx:1.20-alpine
COPY docker/nginx /etc/nginx/conf.d/
RUN rm /etc/nginx/conf.d/default.conf
COPY public/ /var/www/public/

View File

@@ -1,22 +0,0 @@
server {
client_max_body_size 64M;
listen 80;
index index.php index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/public;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_read_timeout 300;
}
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
gzip_static on;
}
}

View File

@@ -1,4 +0,0 @@
file_uploads = On
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300