-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathDockerfile
46 lines (33 loc) · 1 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
FROM php:8.2-fpm
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libpq-dev \
git \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN pecl install apcu \
&& docker-php-ext-enable apcu
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd zip pdo pdo_pgsql
COPY php.ini /usr/local/etc/php/conf.d/custom.ini
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
COPY . /var/www/html
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
RUN cp .env.example .env
ENV APP_ENV=production
ENV APP_DEBUG=false
ENV DB_CONNECTION=pgsql
ENV DB_HOST=db
ENV DB_PORT=5432
ENV DB_DATABASE=app
ENV DB_USERNAME=app
ENV DB_PASSWORD=changethis123
ENV QUEUE_CONNECTION=redis
ENV REDIS_HOST=redis
ENV REDIS_PORT=6379
RUN echo "apc.enable_cli=1" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
CMD ["sh", "-c", "nohup php artisan serve --host=0.0.0.0 "]