forked from gaibz/docker-ubuntu20-php7.4fpm-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (34 loc) · 1.5 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
# Using base ubuntu image
FROM ubuntu:20.04
LABEL Maintainer="Herlangga Sefani <[email protected]>" \
Description="Nginx + PHP7.4-FPM Based on Ubuntu 20.04."
# Setup document root
RUN mkdir -p /var/www/app
# Base install
RUN apt update --fix-missing
RUN DEBIAN_FRONTEND=noninteractive
RUN ln -snf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime && echo Asia/Jakarta > /etc/timezone
RUN apt install git zip unzip curl gnupg2 ca-certificates lsb-release libicu-dev supervisor nginx -y
# Install php7.4-fpm
# Since the repo is supported on ubuntu 20
RUN apt install php-fpm php-json php-pdo php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-intl -y
# Install composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN php -r "unlink('composer-setup.php');"
# Check if installation successfull
RUN composer --help
COPY ./entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
RUN rm /etc/nginx/sites-enabled/default
COPY ./php/php.ini /etc/php/7.4/fpm/php.ini
COPY ./php/www.conf /etc/php/7.4/fpm/pool.d/www.conf
COPY ./nginx/server.conf /etc/nginx/sites-enabled/default.conf
COPY ./supervisor/config.conf /etc/supervisor/conf.d/supervisord.conf
# Starter file
COPY ./php/index.php /var/www/app/index.php
EXPOSE 80
# Let supervisord start nginx & php-fpm
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# # Prevent exit
# ENTRYPOINT ["./entrypoint.sh"]