forked from NijiGon/quizzle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (40 loc) · 1.39 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Use the official PHP image as a base image
FROM php:8.2-fpm
# Set the working directory inside the container
WORKDIR /var/www/html
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpng-dev \
libjpeg62-turbo-dev \
libonig-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
# Get Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install Node.js and npm
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
# Copy composer.json and composer.lock
COPY composer.json composer.lock ./
# Install composer dependencies (run composer install without the --no-dev flag for development)
RUN composer install --no-interaction --no-plugins --no-scripts --no-dev
# Copy the rest of the application code
COPY . .
# Generate the Laravel application key
RUN php artisan key:generate
# Set the permissions for Laravel
RUN chown -R www-data:www-data /var/www/html/storage
RUN chown -R www-data:www-data /var/www/html/bootstrap/cache
RUN echo "memory_limit=512M" > /usr/local/etc/php/conf.d/docker-php-memory-limit.ini
# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]