-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
49 lines (38 loc) · 1.03 KB
/
Dockerfile.prod
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
FROM php:8.0-fpm
# Install system dependencies
RUN apt-get update && apt-get install -y libpq-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libmcrypt-dev \
libpq-dev \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libcurl4-openssl-dev \
zip \
unzip
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo pgsql pdo_pgsql mbstring exif pcntl bcmath gd
# Get latest Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
ENV APP_ENV production
ENV APP_DEBUG false
# Set working directory
WORKDIR /app
COPY . /app
# Install project dependencies
RUN composer install --optimize-autoloader --no-dev
# Optimizing Configuration loading
RUN php artisan config:cache
# Optimizing Route loading
RUN php artisan route:cache
# Optimizing View loading
RUN php artisan view:cache
# Run the server
CMD php artisan serve --host=0.0.0.0 --port $PORT
EXPOSE $PORT