-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
26 lines (20 loc) · 932 Bytes
/
Dockerfile.prod
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
FROM php:8.1.0-cli AS builder
WORKDIR /var/www
RUN mkdir kanban-backend && \
apt-get update && \
apt-get install -y git libzip-dev nano && \
docker-php-ext-install zip && \
docker-php-ext-install pdo_mysql && \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php && \
php -r "unlink('composer-setup.php');" && \
mv composer.phar /usr/local/bin/composer
COPY . /var/www/kanban-backend
FROM php:8.1.0-fpm-alpine
WORKDIR /var/www
RUN rm -rf /var/www/html
COPY --from=builder /var/www/kanban-backend .
RUN chown -R www-data:www-data /var/www
EXPOSE 9000
CMD ["php-fpm"]