-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
executable file
·71 lines (60 loc) · 1.73 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM ubuntu:22.04
USER root
# Set working directory
ENV APPPATH=/var/www/dev/api/current
WORKDIR ${APPPATH}
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf
ENV TZ=Asia/Jakarta
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update -y
RUN apt upgrade -y
RUN apt install rsync openssh-client curl zip unzip wget -y
RUN apt -y install software-properties-common
RUN add-apt-repository -y ppa:ondrej/nginx
RUN add-apt-repository -y ppa:ondrej/php
RUN apt update
RUN apt -y install php8.1
RUN apt -y install php8.1-fpm
# Install dependencies
RUN apt install -y \
build-essential \
libpng-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl \
php8.1-gd \
php8.1-intl \
php8.1-mysql \
php8.1-mbstring \
php8.1-xml \
php8.1-curl \
php8.1-common \
php8.1-cli \
php8.1-bcmath \
php8.1-zip \
php8.1-pgsql \
php8.1-redis
RUN apt install nginx -y
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf
# Configure Nginx
RUN rm /etc/nginx/sites-enabled/default
RUN mkdir -p /var/www/dev/web-front-end/current
RUN mkdir -p /var/www/dev/api/current
COPY nginx/dev /etc/nginx/sites-available/
RUN ln -s /etc/nginx/sites-available/dev /etc/nginx/sites-enabled/dev
# Configure PHP
COPY ./php/local.ini /usr/local/etc/php/conf.d/local.ini
# Clear cache
RUN apt clean && rm -rf /var/lib/apt/lists/*
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN apt update -y
RUN apt install php8.1-imagick -y
RUN echo "extension=imagick.so;" >> /etc/php/8.1/cli/php.ini
# Start php-fpm and nginx server
CMD service php8.1-fpm start && nginx