-
-
Notifications
You must be signed in to change notification settings - Fork 317
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 692 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 692 Bytes
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
# use bullseye variant because it doesn't have network issue in m1 mac & intel
FROM php:8.1-fpm-bullseye
# Install dependencies
RUN apt-get update
RUN apt-get install -y zip nginx git
RUN useradd -r nginx
# Install PHP-Mysql extensions
RUN docker-php-ext-install pdo pdo_mysql \
&& docker-php-ext-enable pdo_mysql
WORKDIR /var/www
# Copy source code
COPY . .
RUN mv nginx.conf /etc/nginx/nginx.conf
# Install composer
COPY --from=composer:2.2 /usr/bin/composer /usr/bin/composer
RUN composer install
RUN composer dumpautoload --optimize
# Copy .env file
COPY .env.example .env
# Set up permissions
RUN chown -R www-data:www-data /var/www
ENTRYPOINT make init && nginx && php-fpm