File tree Expand file tree Collapse file tree 6 files changed +95
-0
lines changed Expand file tree Collapse file tree 6 files changed +95
-0
lines changed Original file line number Diff line number Diff line change
1
+ <VirtualHost *:80>
2
+
3
+ ServerAdmin webmaster@localhost
4
+ DocumentRoot /var/www/html/public/
5
+
6
+ <Directory /var/www/>
7
+ AllowOverride All
8
+ Require all granted
9
+ </Directory>
10
+
11
+ ErrorLog ${APACHE_LOG_DIR}/error.log
12
+ CustomLog ${APACHE_LOG_DIR}/access.log combined
13
+
14
+ </VirtualHost>
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e; # Exit immediately if a command exits with a non-zero status.
3
+
4
+ if [ " $APP_ENV " = " production" ]; then
5
+ /usr/local/bin/php /var/www/html/artisan migrate --force;
6
+ else
7
+ /usr/local/bin/php /var/www/html/artisan migrate;
8
+ fi
9
+
10
+ /usr/local/bin/php /var/www/html/artisan optimize;
11
+
12
+ exec apache2-foreground;
Original file line number Diff line number Diff line change
1
+ [opcache]
2
+ opcache.enable =1
3
+ opcache.revalidate_freq =0
4
+ opcache.validate_timestamps =0
5
+ opcache.max_accelerated_files =10000
6
+ opcache.memory_consumption =192
7
+ opcache.max_wasted_percentage =10
8
+ opcache.interned_strings_buffer =16
9
+ opcache.jit_buffer_size =100M
Original file line number Diff line number Diff line change
1
+ .git
2
+ .env
3
+ .idea
4
+ .vscode
5
+ node_modules
6
+ vendor
7
+ storage /framework /cache /**
8
+ storage /framework /sessions /**
9
+ storage /framework /testing /**
10
+ storage /framework /views /**
11
+ storage /logs /**
Original file line number Diff line number Diff line change @@ -16,3 +16,6 @@ indent_size = 2
16
16
17
17
[docker-compose.yml ]
18
18
indent_size = 4
19
+
20
+ [* .sh ]
21
+ end_of_line = lf
Original file line number Diff line number Diff line change
1
+ # Stage 1: Build
2
+ FROM composer:lts as build
3
+
4
+ WORKDIR /app
5
+
6
+ COPY . /app/
7
+
8
+ # Install dependencies
9
+ RUN composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction --no-progress
10
+
11
+ # Stage 2: Production
12
+ FROM php:8.1-apache as production
13
+
14
+ ENV APP_ENV=production
15
+ ENV APP_DEBUG=false
16
+
17
+ # Install Postgres driver
18
+ RUN apt-get update && \
19
+ apt-get install -y libpq-dev
20
+
21
+ # Install PHP extensions
22
+ RUN docker-php-ext-configure opcache --enable-opcache && \
23
+ docker-php-ext-install pdo pdo_mysql pdo_pgsql
24
+
25
+ RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
26
+
27
+ # Copy opcache config
28
+ COPY .docker/php/conf.d/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
29
+
30
+ # Copy application
31
+ COPY --from=build /app /var/www/html
32
+
33
+ # Copy apache config
34
+ COPY .docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf
35
+
36
+ # Copy entrypoint
37
+ COPY .docker/entrypoint.sh /entrypoint.sh
38
+
39
+ # Copy configure script
40
+ RUN chown -R www-data:www-data /var/www/ && \
41
+ a2enmod rewrite
42
+
43
+ EXPOSE 80
44
+
45
+ # Run Entrypoint
46
+ ENTRYPOINT [ "/entrypoint.sh" ]
You can’t perform that action at this time.
0 commit comments