-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (53 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
68 lines (53 loc) · 1.28 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
FROM php:8.2-fpm
ENV COMPOSER_MEMORY_LIMIT=-1
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libwebp-dev \
libfreetype6-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
libicu-dev \
default-mysql-client \
git unzip curl
RUN docker-php-ext-install \
pdo \
pdo_mysql \
mbstring \
xml \
zip \
exif \
pcntl \
intl \
gd \
ftp
RUN docker-php-ext-configure gd \
--with-jpeg \
--with-freetype \
--with-webp \
&& docker-php-ext-install gd
# Redis
RUN pecl install redis && docker-php-ext-enable redis
# Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www
# Copy composer files first
COPY composer.json composer.lock ./
RUN composer install \
--no-interaction \
--prefer-dist \
--optimize-autoloader \
--no-scripts
# Copy project
COPY . .
# Permissions
RUN chown -R www-data:www-data /var/www \
&& chmod -R 775 storage bootstrap/cache
# Copy entrypoint script
COPY docker/php/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Set entrypoint
ENTRYPOINT ["entrypoint.sh"]
# Default command (for development, Laravel serve)
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]