-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
79 lines (63 loc) · 2.24 KB
/
Dockerfile
File metadata and controls
79 lines (63 loc) · 2.24 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
69
70
71
72
73
74
75
76
77
78
79
FROM dunglas/frankenphp:php8.4
ENV COMPOSER_PROCESS_TIMEOUT=600
WORKDIR /var/www
COPY composer.* /var/www/
RUN apt-get update && apt-get install -y \
cron \
nodejs \
npm \
libfreetype6-dev \
libjpeg62-turbo-dev \
libwebp-dev \
libmcrypt-dev \
libxml2-dev \
libzip-dev \
libc-dev \
libicu-dev \
wget \
zlib1g-dev \
zip \
default-mysql-client \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j"$(nproc)" gd pdo pdo_mysql soap zip iconv bcmath intl \
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
&& docker-php-ext-configure pcntl --enable-pcntl \
&& docker-php-ext-install pcntl \
&& docker-php-ext-install sockets \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Redis (PHP 8.4 compatible)
RUN pecl install redis-6.3.0 \
&& docker-php-ext-enable redis \
&& rm -rf /tmp/pear
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer
# Send update for php.ini
COPY ./init/php.development.ini /usr/local/etc/php/php.ini
# Copy the application
COPY . /var/www
# for local development and using google cloud services, we need to set the GOOGLE_APPLICATION_CREDENTIALS to point to the service account credentials file.
# In production, this will be set to the default application credentials provided by the environment.
# ENV GOOGLE_APPLICATION_CREDENTIALS=/var/www/application_default_credentials.json
# Composer & laravel
RUN composer install --optimize-autoloader \
&& npm install --save-dev chokidar \
&& chmod -R 777 storage bootstrap/cache \
&& php artisan optimize:clear \
&& php artisan optimize \
&& php artisan config:clear \
&& php artisan ide-helper:generate \
&& php artisan octane:install \
&& composer dumpautoload
# Generate Swagger
RUN php artisan l5-swagger:generate
# Cleanup unwanted files
RUN rm /var/www/public/.htaccess
# Add symbolic link for public file storage
RUN php artisan storage:link
COPY ./docker/start.sh /var/www/docker/start.sh
RUN chmod +x /var/www/docker/start.sh
# Expose port
EXPOSE 8000
# Starts both, laravel server and job queue
CMD ["/var/www/docker/start.sh"]