Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (46 loc) · 1.98 KB
/
Copy pathDockerfile
File metadata and controls
69 lines (46 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM php:8.4-apache
# Install system dependencies
RUN apt-get update && apt-get install -y git zip unzip
RUN curl -L https://deb.nodesource.com/nsolid_setup_deb.sh | bash -s -- 20 && apt-get install nodejs -y
# Install PHP extensions (bcmath required by google/cloud-tasks)
RUN docker-php-ext-install pdo_mysql bcmath
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www
# Copy existing application directory
COPY . .
# Change ownership of storage and cache
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
COPY public/.htaccess /var/www/html/.htaccess
# Install Laravel dependencies
RUN composer install
# Install Vite
RUN npm install --global vite
# Install Vue 3 project dependencies
RUN npm install
# Build the Vue 3 project
RUN npm run build
# Copy public folder to Apache directory
RUN cp -R public/* /var/www/html/
# Copy Apache configuration files
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
COPY ports.conf /etc/apache2/ports.conf
# Add ServerName directive to Apache configuration
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# Enable site and Apache modules
RUN a2ensite 000-default && a2enmod rewrite headers
# Cloud Run already logs every request; Apache's copy on stdout only doubles the bill.
RUN a2disconf other-vhosts-access-log
# PHP defaults to a 2M upload cap, well under the 10M the uploader advertises.
# Over that, the file never reaches PHP and the request looks like it carried none.
# The 128M default runs out on whole-career player queries in the async worker.
RUN echo "upload_max_filesize=10M" > /usr/local/etc/php/conf.d/custom.ini \
&& echo "post_max_size=12M" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "memory_limit=512M" >> /usr/local/etc/php/conf.d/custom.ini
RUN echo "LimitRequestFieldSize 16384" >> /etc/apache2/apache2.conf
# Open port 8000
EXPOSE 8000
RUN a2enmod rewrite
# Start Apache
CMD ["apache2-foreground"]