-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
38 lines (26 loc) · 856 Bytes
/
dockerfile
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
# Use an official PHP image with the necessary extensions
FROM php:8.1-fpm
# Set the working directory for your project "mister_quiz"
WORKDIR /var/www/mister_quiz
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
zip \
unzip \
git \
curl \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql bcmath
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy project files to container
COPY . .
# Install Composer dependencies
RUN composer install --no-dev --optimize-autoloader
RUN chown -R www-data:www-data /var/www/mister_quiz/storage /var/www/mister_quiz/bootstrap/cache
# Expose the PHP-FPM port
EXPOSE 9000
# Start the PHP-FPM server
CMD ["php-fpm"]