-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (63 loc) · 1.93 KB
/
Dockerfile
File metadata and controls
78 lines (63 loc) · 1.93 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
FROM dunglas/frankenphp:php8.4
ENV COMPOSER_PROCESS_TIMEOUT=600
ENV REBUILD_DB=1
WORKDIR /var/www
COPY composer.* /var/www/
RUN apt-get update && apt-get install -y \
nodejs \
npm \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libxml2-dev \
libzip-dev \
libc-dev \
libgmp-dev \
wget \
zlib1g-dev \
zip \
default-mysql-client \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j"$(nproc)" gd pdo pdo_mysql soap zip iconv bcmath gmp \
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
&& docker-php-ext-install sockets \
&& docker-php-ext-install exif \
&& docker-php-ext-configure pcntl --enable-pcntl \
&& docker-php-ext-install pcntl \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /etc/pki/tls/certs && \
ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
# Install Redis
RUN apt-get update && apt-get install -y \
autoconf \
g++ \
make \
&& pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis
# 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
# Composer & laravel
RUN composer install \
&& php artisan octane:install \
&& php artisan storage:link \
&& php artisan optimize:clear \
&& php artisan optimize \
&& php artisan cache:clear \
&& php artisan config:clear \
&& chmod -R 777 storage bootstrap/cache \
&& chown -R www-data:www-data storage \
&& composer dumpautoload
# Generate Swagger
RUN php artisan l5-swagger:generate
# Cleanup unwanted files
RUN rm /var/www/public/.htaccess
# Starts both, laravel server and job queue
CMD ["/var/www/docker/start.sh"]
# Expose port
EXPOSE 8100